OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



OCS Plugin: Static Pages

The Plugin Gallery is a venue for users of PKP software to share their plugins.

Moderators: jmacgreg, michael, John

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

OCS Plugin: Static Pages

Postby jalperin » Wed Nov 05, 2008 6:18 pm

This plugin is useful for creating Static Content.

Through the Conference Manager -> System Plugins interface, you can add/edit/delete pages that are comprised of text/HTML. Once a page is created, it can be accessed at: http://www.conferenceUrl.../index.php/{conf_initials}/index/pages/view/{page_name}.

Author: Juan Pablo Alperin
Software: OCS
Versions: 2.1+
Multilingual: yes
Requirements: TinyMCE plugin must be enabled

This plugin is a port of the OJS Static Pages Plugin: http://pkp.sfu.ca/support/forum/viewtopic.php?f=28&t=3437
Attachments
staticPagesPluginOCS-1.0.tar.gz
(14.48 KiB) Downloaded 1008 times
jalperin
 
Posts: 158
Joined: Thu Jul 06, 2006 1:03 pm
Location: Buenos Aires

Re: OCS Plugin: Static Pages

Postby matnet » Mon Dec 29, 2008 6:47 am

Hi. i have tried to install the plugin. My site (happinesseconomics.net) is hosted at a remote provider. I cannot run shell scripts on it. And therefore i cannot "install the database schema run the following command from your OCS directory:
$ php tools/dbXMLtoSQL.php -schema execute plugins/generic/staticPages/schema.xml

I was trying to upload a file with the following instrucitons (please consider that i do not know anything of php)
<?php
echo shell_exec ("/ocs/tools/dbXMLtoSQL.php -schema execute /ocs/plugins/generic/staticPages/schema.xml");
?>

even from the cgi-bin folder with premissions 755, but it returns that "shell_exec() has been disabled for security reasons"

How do i get around this?

thanks
matnet
 
Posts: 19
Joined: Mon Dec 29, 2008 6:39 am

Re: OCS Plugin: Static Pages

Postby asmecher » Mon Dec 29, 2008 9:34 am

Hi matnet,

If you have access to a tool like phpMyAdmin, the easiest thing to do is probably to convert the schema to SQL (either manually or by running tools/dbXMLtoSQL.php on another machine) and execute it through phpMyAdmin. Alternately, you can modify the tools/includes/cliTool.inc.php script to remove the check that ensures that you're not running the script remotely. If you try this, you'll also need to manually set the command-line argument variables in the script, since you won't be running it from a command line.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: OCS Plugin: Static Pages

Postby matnet » Tue Dec 30, 2008 12:25 am

Thanks Alec. I think the only thing i can do is to manually build the table via phpMyadmin. It should be easy, but remeber i am pretty new to this stuff.

I had a look at the schema.xml (below) to see how the two tables are structured and here is what i don't understand
-there are three types of fields: I8, C2 and X. what do they correspond to?
-line 51, the tag field is opened but not closed befoe a new tag field is opened again in line 52. Why is that? are they kind of nested fields?
line 56-65: i don't understand what's going on here. what is this index and col tags?

many thanks again if you find time to help me out.

1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE schema SYSTEM "../../../dbscripts/xml/dtd/xmlschema.dtd">
3
4 <!--
5 * schema.xml
6 *
7 * Copyright (c) 2003-2008 John Willinsky
8 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
9 *
10 * StaticPages plugin schema in XML.
11 *
12 -->
13
14 <schema version="0.2">
15
16 <!--
17 *
18 * TABLE static_pages
19 *
20 -->
21 <table name="static_pages">
22 <field name="static_page_id" type="I8">
23 <KEY/>
24 <AUTOINCREMENT/>
25 </field>
26 <field name="path" type="C2" size="255">
27 <NOTNULL/>
28 </field>
29 <field name="conference_id" type="I8">
30 <NOTNULL/>
31 </field>
32 <descr>Static Pages</descr>
33 </table>
34
35 <!--
36 *
37 * TABLE static_page_settings
38 *
39 -->
40 <table name="static_page_settings">
41 <field name="static_page_id" type="I8">
42 <NOTNULL/>
43 </field>
44 <field name="locale" type="C2" size="5">
45 <NOTNULL/>
46 <DEFAULT VALUE=""/>
47 </field>
48 <field name="setting_name" type="C2" size="255">
49 <NOTNULL/>
50 </field>
51 <field name="setting_value" type="X"/>
52 <field name="setting_type" type="C2" size="6">
53 <NOTNULL/>
54 <descr>(bool|int|float|string|object)</descr>
55 </field>
56 <descr>Static Page settings.</descr>
57 <index name="static_page_settings_static_page_id">
58 <col>static_page_id</col>
59 </index>
60 <index name="static_page_settings_pkey">
61 <col>static_page_id</col>
62 <col>locale</col>
63 <col>setting_name</col>
64 <UNIQUE />
65 </index>
66 </table>
67
68 </schema>
matnet
 
Posts: 19
Joined: Mon Dec 29, 2008 6:39 am

Re: OCS Plugin: Static Pages

Postby asmecher » Tue Dec 30, 2008 12:48 am

Hi matnet,

The XML conforms to the ADODB database schema DTD, which is described at http://phplens.com/lens/adodb/docs-datadict.htm.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: OCS Plugin: Static Pages

Postby matnet » Tue Dec 30, 2008 3:34 am

excellent! many thanks
matnet
 
Posts: 19
Joined: Mon Dec 29, 2008 6:39 am

Re: OCS Plugin: Static Pages

Postby mendesrocha » Wed Jan 07, 2009 7:54 pm

I tried to install this plugin and my server returned me the following message after I ran the command to install the database schema.

[cbce@hm857 congressos]$ php tools/dbXMLtoSQL.php -schema execute plugins/generic/staticPages/schema.xml
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/oci8.so ' - libclntsh.so.11.1: failed to map segment from shared
object: Cannot allocate memory in Unknown on line 0


Neverthless, the plugin seems to be installed, I checked at my phpmyadmin and the database table seens to be OK.

I even tested the plugin, the static pages was successfully created. The only strange thing is the following text in my plugins page

##plugins.generic.staticPages.displayName##: ##plugins.generic.staticPages.description##
Desabilitar ##plugins.generic.staticPages.editAddContent##


Does anyone know why is it appearing like that?
mendesrocha
 
Posts: 178
Joined: Mon Nov 05, 2007 11:10 am
Location: Brazil

Re: OCS Plugin: Static Pages

Postby asmecher » Wed Jan 07, 2009 9:24 pm

Hi mendesrocha,

The command-line version of PHP and the web-based version often use different php.ini configuration files; I suspect your command-line php.ini specifies something that's causing PHP to choke. In particular, I'd suggest double-checking the list of extensions that are being loaded in the CLI PHP's php.ini.

The ##some.text.here## messages are probably appearing because of an incomplete Spanish locale for that plugin. Have a look in plugins/generic/staticPages/locale to see if there's a complete es_ES. If not, and if you do create one (based on the en_US English files), please consider contributing back to us so we can distribute them with the plugin.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: OCS Plugin: Static Pages

Postby jalperin » Thu Jan 08, 2009 3:12 am

medesrocha,

I never got around to translating to OCS version of the plugin to spanish. However, a user translated the OJS version of the plugin and the keys are quite similar if I recall correctly. You can try downloading the file linked from http://pkp.sfu.ca/support/forum/viewtopic.php?f=28&t=3437#p14266 and placing it in a folder named es_ES inside the locale folder. Most of the keys should be the same, but if you see any other ## ## then you can just add it to the spanish version of locale.xml.

Juan
jalperin
 
Posts: 158
Joined: Thu Jul 06, 2006 1:03 pm
Location: Buenos Aires

Re: OCS Plugin: Static Pages

Postby mendesrocha » Thu Jan 08, 2009 3:42 am

Hello Alec,

Concerning the first error I will contact my server admin and ask him to check for it.

Following your suggestion, I have just translated the plugin locale file to Portuguese. I used the tool avaiable in the OCS and it was easier than I thought.

I am attaching the translation file in this post. I am glad I am able to contribute with PKP.

Renato
Attachments
pt_BR.rar
Portuguese (Br) translation for Static Pages Plugin
(1.08 KiB) Downloaded 379 times
mendesrocha
 
Posts: 178
Joined: Mon Nov 05, 2007 11:10 am
Location: Brazil

Re: OCS Plugin: Static Pages

Postby mendesrocha » Thu Jan 08, 2009 3:46 am

I think I found a little bug

When click in the edit button of an static page, the server returns me the following

Code: Select all
Notice: Only variables should be assigned by reference in /home/cbce/public_html/congressos/plugins/generic/staticPages/StaticPagesEditForm.inc.php on line 72


And, almost the same when I press the Save button in the Edition Page for my Static page.

Code: Select all
Notice: Only variables should be assigned by reference in /home/cbce/public_html/congressos/plugins/generic/staticPages/StaticPagesEditForm.inc.php on line 142


Despite this error the plugin is working properly.
mendesrocha
 
Posts: 178
Joined: Mon Nov 05, 2007 11:10 am
Location: Brazil

Re: OCS Plugin: Static Pages

Postby jalperin » Wed Feb 11, 2009 10:06 am

mendesrocha,

You're right. It is a small bug. If I am not mistaken you just need to add an & on line 18 of StaticPagesDAO.inc.php.
It should read:
Code: Select all
function &getStaticPage($staticPageId) {


However, what you're seeing is just a PHP warning. If this is a production site, you should probably disable display_errors in php.ini so that users don't see these warnings should they occur anywhere else in the system. I will correct this the next release of the plugin.

Thanks,
jalperin
 
Posts: 158
Joined: Thu Jul 06, 2006 1:03 pm
Location: Buenos Aires

Re: OCS Plugin: Static Pages

Postby borgher » Thu Feb 26, 2009 1:53 am

Hi Jalperin,

many thanks for the OCS Static Pages plugin - a great and useful addition indeed.

I've installed the plugin on OCS 2.1.0.1. I had no problem in creating the db schema, and everything seemed to go fine during installation. The plugin showed correctly under the Generic Plugin tab and I was able to activate it.

However, if I create and save a page, when I revisit the Static Pages plugin the page does not show up - nor I can access it through the web address. I've checked the database, and both tables remain empty after I save the page.

I know that's very little information for the time being, but I would much appreciate your help to understand what's going wrong.

cheers,
borgher
borgher
 
Posts: 2
Joined: Tue Feb 24, 2009 8:21 pm

Re: OCS Plugin: Static Pages

Postby jalperin » Thu Feb 26, 2009 6:38 am

borgher,

Not sure what might be happening. Could you give me a more detailed description on the steps you've taken to create a new page? Are you receiving any errors?
jalperin
 
Posts: 158
Joined: Thu Jul 06, 2006 1:03 pm
Location: Buenos Aires

Re: OCS Plugin: Static Pages

Postby nageshdbt » Wed Mar 11, 2009 8:22 am

Dear sir,

after uploading static page plugin in ocs server. after enable /setting. system says following error DB Error: Table 'conf.static_pages' doesn't exist

please help me out.

thanks and regards
nageswaran
nageshdbt
 
Posts: 54
Joined: Mon Feb 13, 2006 4:18 am

Next

Return to Plugin Gallery

Who is online

Users browsing this forum: No registered users and 1 guest