Advanced Customization

From SubjectsPlus

Jump to: navigation, search

Contents

Creating a Simple New "Fixed Pluslet"

Fixed pluslets are ones that the admin might set up so that all users can share them. Examples that come by default are the librarian info, legend, catalog search and all items pluslets. They can be either PHP files (which will be added to the page with an include() function) or HTML (with file_get_contents). Not sure about other content, but you can try it out.

So, let's try creating a Hello World pluslet, that will print out "Hello World."

Create the file

Assuming this is a php file, you would create a full php file that adds something to the $pluslet variable. I.e.,

  <?php 
$ourtext = "Hello, World!";
$pluslet .= $ourtext;
 ?>

Save the file

You will need to save the file in the assets/fixed_pluslets/ directory, with an appropriate name, say, hiworld.php.

Register the file in the DB

Next, add the pluslet's metadata to the pluslet table. Through PHPMyAdmin or however you like to do these things, make a new entry. The title field will be what shows up a) in the draggable pluslet in the Guide editing portion of the admin, b) in the title line of both admin and public pluslet. The body field should be blank. The local_file field should be the filename of your pluslet, in this case, hiworld.php. clone should be 0, type should be blank or NULL, and extra should be blank or NULL for now. Below is an example from the insert tab in PHPMyAdmin.

File:Hiworld.jpg

Or an insert like so, if you prefer:

  INSERT INTO `subsplus`.`pluslet` (`pluslet_id`, `title`, `body`, `local_file`, `clone`, `type`, `extra`) 
  VALUES (NULL, 'Helloooo, World!', , 'hiworld.php', '0', NULL, NULL);


At this point, your new simple fixed_pluslet should appear in the draggable list of pluslets when you edit a guide, i.e.:

File:New_pluslet.jpg

Some Tips

  • If you want to use a variable set in the config.php file, but not used in the calling file, you will need to access the global scope. I.e., if you wanted to include the administrator email (set in the config.php file), you'd need to stick
 global $administrator_email;

somewhere, or else the included file won't be aware of it.

Creating a Pluslet that needs user-supplied data

Coming soonish. Write to the Google Group if you're impatient to get started . . .

Creating a "Meebo Me" Chat Pluslet

If your library uses a single Meebo account to chat with patrons and you would like to create a "Meebo Me" Pluslet, do the following:

  • Login to your Meebo account and create a chat widget per the instructions at: http://www.meebo.com/support/article/61/
  • Using PHPMyAdmin, create a new entry in the Pluslet table (see the instructions above in Register the file in the DB)
  • Copy the Meebo chat widget code per Meebo's instructions (linked above)
  • Paste the Meebo widget code into a text file and save using the same file name you specified in the Pluslet table entry (e.g., something like "meebo-chat.html")
  • Upload the HTML file to the assets/fixed_pluslets/ directory on your server

If you would like to resize the dimensions of the Meebo chat widget, you can do so by editing the values in the widget code you pasted into the text file. The dimensions are specified twice, once in the <object> tag and then again in the <embed> tag, so be sure to alter both sets of values with the same numbers!

If your staff have individual Meebo accounts and you want patrons to be able to chat with specific librarians, you can create a Pluslet for each librarian by adding table entries for each, naming Pluslets after each librarian (e.g., "Susan's Meebo") and then pasting Meebo widget code from their Meebo accounts into separate HTML files.

Personal tools