OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



OJS Plugin: Custom Block Manager

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

Moderators: jmacgreg, michael, John

Forum rules
If you post a plugin here, please include information on which versions of which applications it is compatible with. Attach a tarball of the plugin (e.g. tar cvzf myPlugin-0.1.tar.gz plugins/generic/myPlugin). Thanks for contributing!

OJS Plugin: Custom Block Manager

Postby jalperin » Fri Aug 15, 2008 8:36 am

This plugin is intended to enable users to create customizable HTML blocks for the sidebars. The plugin works in conjunction with Step 5 of the Journal Setup.

Once the plugin is enabled, blocks can be added and deleted through the management interface. Blocks created through this interface will subsequently appear as their own Block Plugin and can have their content edited with the TinyMCE HTML editor. Sidebar blocks can then be arranged in the sidebar through Journal Setup Step 5.6 (Journal Layout)

Author: Juan Pablo Alperin
Software: OJS
Version: 2.2+
Multilingual: NO

Version History:
1.0 - Initial Release - August 15, 2008

1.0.1 - minor release - November 3, 2008
- fixed problem with sequencing

1.0.2 - minor release - November 5, 2008
- fixed the sequencing problem again
Attachments
customBlockManager-1.0.2.tar.gz
(12.85 KiB) Downloaded 1545 times
customBlockManager.tar.gz
(12.84 KiB) Downloaded 624 times
Last edited by jalperin on Wed Nov 05, 2008 6:00 pm, edited 3 times in total.
jalperin
 
Posts: 157
Joined: Thu Jul 06, 2006 1:03 pm
Location: Buenos Aires

Re: OJS Plugin: Custom Block Manager

Postby mcrider » Wed Sep 17, 2008 12:40 pm

Hi Juan,

Unfortunately this plugin isn't working completely for me.. When I click on the settings link, I get these errors:
Code: Select all
Warning: Missing argument 2 for PluginSettingsDAO::_getCache(), called in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 146 and defined in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 20

Notice: Undefined variable: pluginName in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 28

Notice: Undefined variable: pluginName in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 32

Notice: Undefined variable: pluginName in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 31

Notice: Undefined variable: pluginName in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 36

Warning: Missing argument 2 for PluginSettingsDAO::_getCache(), called in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 146 and defined in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 20

Notice: Undefined variable: pluginName in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 28

Notice: Undefined variable: pluginName in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 36

Warning: Missing argument 2 for PluginSettingsDAO::_getCache(), called in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 146 and defined in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 20

Notice: Undefined variable: pluginName in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 28

Notice: Undefined variable: pluginName in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 36

Warning: Missing argument 2 for PluginSettingsDAO::_getCache(), called in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 146 and defined in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 20

Notice: Undefined variable: pluginName in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 28

Notice: Undefined variable: pluginName in /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php on line 36

Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php:20) in /Applications/MAMP/bin/mamp/ojs2-stable/classes/template/TemplateManager.inc.php on line 240

Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/bin/mamp/ojs2-stable/classes/plugins/PluginSettingsDAO.inc.php:20) in /Applications/MAMP/bin/mamp/ojs2-stable/classes/template/TemplateManager.inc.php on line 243


And though I can proceed with making a block and enabling it, Only the text content appears in the block, but no title.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: OJS Plugin: Custom Block Manager

Postby jalperin » Mon Sep 22, 2008 5:57 am

Mat,

You were right. There's a patch that never made it into 2.2.2 (I thought it had).

**EDIT

The patch that was previously posted here was changed. Until the next version of OJS, users will need to make a simple change in the deleteSetting method of PluginSettingsDAO. Specifically, the line inside deleteSetting that reads:
Code: Select all
$cache =& $this->_getCache($pluginName);
needs to be changed to
Code: Select all
$cache =& $this->_getCache($journalId, $pluginName);
.

The entire method should then look like this:

classes/plugins/PluginSettingsDAO.inc.php
Code: Select all
   /**
    * Delete a plugin setting.
    * @param $journalId int
    * @param $pluginName int
    * @param $name string
    */
   function deleteSetting($journalId, $pluginName, $name) {
      $cache =& $this->_getCache($journalId, $pluginName);
      $cache->setCache($name, null);

      return $this->update(
         'DELETE FROM plugin_settings WHERE plugin_name = ? AND setting_name = ? AND journal_id = ?',
         array($pluginName, $name, $journalId)
      );
   }
jalperin
 
Posts: 157
Joined: Thu Jul 06, 2006 1:03 pm
Location: Buenos Aires

Re: OJS Plugin: Custom Block Manager

Postby sharrison » Mon Nov 03, 2008 12:22 pm

Bug report? When I use this plugin (customBlockManager) to create static content blocks for my sidebars, I am able to reposition the block on the left sidebar but not on the right sidebar. In other words, when I create a static content block and place it on the right sidebar, it only ever appears on the top of the right sidebar. This relates to the configuration features on the "Using the Home > User > Journal Management > Journal Setup > Customizing the Look > Journal Layout" part of the OJS interface.
sharrison
 
Posts: 3
Joined: Wed Aug 23, 2006 12:40 pm

Re: OJS Plugin: Custom Block Manager

Postby jalperin » Mon Nov 03, 2008 2:13 pm

sharrison,

You're right. Its a bug. Took me a while to figure it out, but you can fix it by changing CustomBlockManagerPlugin.inc.php

around line 74 you will find:
Code: Select all
$plugins[$category][$blockPlugin->getSeq()+$i] =& $blockPlugin;
Go ahead and change this to:
Code: Select all
$plugins[$blockPlugin->getSeq()][$blockPlugin->getPluginPath()+$i] =& $blockPlugin;
.

Of course, you can also just install the latest tar.gz file, which I am about to upload.

Thanks for pointing this out!
jalperin
 
Posts: 157
Joined: Thu Jul 06, 2006 1:03 pm
Location: Buenos Aires

Re: OJS Plugin: Custom Block Manager

Postby Roelf » Sun Dec 07, 2008 9:17 am

Dear Juan,

Thank you. This is a great plugin. It works perfectly after editing the PuginSettingsDAO.inc.php file.

I noticed that it is also possible to insert images in the blocks by editing the HTML code and using the <img> command.

Roelf
Roelf
 
Posts: 5
Joined: Mon Dec 01, 2008 4:02 am

Re: OJS Plugin: Custom Block Manager

Postby kekropas » Tue Dec 30, 2008 8:30 am

amazing job, thank you very much!!! It works like a charm!
Do you know if it would be possible to write php inside the plugin? I am trying to figure out a way that the plugin communicates with my database
kekropas
 
Posts: 38
Joined: Sat Dec 20, 2008 5:56 am

Re: OJS Plugin: Custom Block Manager

Postby hndrylee » Wed Mar 25, 2009 1:24 pm

Hi,
I am trying to input some php code in the custom block that I have created, but, it ended up splitting all the php source code out to the browser instead of the intended result. Is there any way to include my php code in the custom block?
thanks
hndrylee
 
Posts: 3
Joined: Mon Mar 09, 2009 8:21 am

Re: OJS Plugin: Custom Block Manager

Postby jalperin » Wed Mar 25, 2009 1:27 pm

hndrylee,

No. The Custom Block plugin is intended to put HTML only. If you know some PHP and can do some light programming, I recommend you look at some of the other block plugins (for example, the developedBy or navigation blocks) and use those to guide your development.

Good luck,
jalperin
 
Posts: 157
Joined: Thu Jul 06, 2006 1:03 pm
Location: Buenos Aires

Re: OJS Plugin: Custom Block Manager

Postby fireport » Thu Apr 30, 2009 3:11 am

I need to put the content of this page (https://ire035/ojs-test/index.php/test/ ... torialTeam) inside a custom block. Can you help me ?
fireport
 
Posts: 30
Joined: Tue Mar 31, 2009 3:57 am

Re: OJS Plugin: Custom Block Manager

Postby jalperin » Thu Apr 30, 2009 5:43 am

Your best best is to program this as its own Block Plugin. There is information on the wiki about how to to this.

You can look at the code in pages/about/AboutHandler.inc.php and the template in templates/about/editorialTeam.tpl to help you with what the put inside the code/template.
jalperin
 
Posts: 157
Joined: Thu Jul 06, 2006 1:03 pm
Location: Buenos Aires

Re: OJS Plugin: Custom Block Manager

Postby hilmiapak » Wed Aug 12, 2009 3:01 am

This is a great plugin. This gives great flexibility to us.
A little help for users with little attention like me: There are two lines in PluginSettingsDAO.inc.php:
lines 146 and 160 to be changed to
[i]$cache =& $this->_getCache($journalId, $pluginName);[/i]

with this plugin you can do a sidebar menu which I am going to try out.
In addition I have translated your plugin into turkish, and attached
Attachments
locale.zip
Turkish locale file for custom block manager
(1023 Bytes) Downloaded 301 times
hilmiapak
 
Posts: 5
Joined: Thu Nov 17, 2005 9:29 am

Re: OJS Plugin: Custom Block Manager

Postby crlsgms » Wed Oct 21, 2009 10:21 am

Hi! iv discompacted the .tar.gz into my /ojs/plugins/generic, fixed the permissions and it appears on my journal plugins page, but with an error on its name, as on the attachment. Did i made something wrong?
Attachments
block error.JPG
naming problem with plugin
block error.JPG (64.49 KiB) Viewed 13886 times
crlsgms
 
Posts: 28
Joined: Wed Jul 22, 2009 12:50 pm
Location: Franca - sp, brazil

Re: OJS Plugin: Custom Block Manager

Postby jmacgreg » Thu Oct 22, 2009 11:07 am

Hi Carlos,

Can you doublecheck that plugins/generic/customBlockManager/locale/en_US/locale.xml exists?

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: OJS Plugin: Custom Block Manager

Postby shandman » Sun Nov 08, 2009 7:35 am

hey great plugin I have modified it for OCS http://pkp.sfu.ca/support/forum/viewtopic.php?f=28&t=5308, thanks again great plugin.
shandman
 
Posts: 2
Joined: Sat Nov 07, 2009 1:55 pm

Next

Return to Plugin Gallery

Who is online

Users browsing this forum: No registered users and 1 guest