Pixelpost

Authentic Photoblog Flavour

ExtendingPixelpost /

ExtendingPixelpost.CreatingAddons History

Hide minor edits - Show changes to markup

December 07, 2007, at 04:14 AM by 84.62.14.236 -
Changed lines 71-72 from:
  • You have to name your Addon file like admin_addonname.php if you want to use admin workspaces.
to:
  • You have to name your Addon file like admin_addonname.php if you want to use admin workspaces.
Changed lines 163-164 from:

You have to name your Addon file like front_addonname.php if you want to use front workspaces.

to:

You have to name your Addon file like front_addonname.php if you want to use front workspaces.

December 07, 2007, at 04:13 AM by 84.62.14.236 -
Changed lines 19-20 from:

The logic behind the Admin addons is simple: Whenever one of the Admin pages is called, a list of addon functions and their assigned location (=workspace) is stored in an array. At every workspace in the core code the related functions from Admin addons are performed in run-time.

to:

The logic behind the Admin addons is simple: Whenever one of the Admin pages is called, a list of addon functions and their assigned location (=workspace) is stored in an array. At every workspace in the core code the related functions from Admin addons are performed in run-time.

Changed lines 71-72 from:
to:
  • You have to name your Addon file like admin_addonname.php if you want to use admin workspaces.
Changed lines 163-164 from:
to:

You have to name your Addon file like front_addonname.php if you want to use front workspaces.

November 06, 2007, at 06:33 AM by austriaka -
Changed lines 94-95 from:
to:
Changed lines 166-167 from:
to:
November 06, 2007, at 06:32 AM by austriaka -
Added line 1:

(:nogroupfooter:)

Changed lines 45-46 from:
to:
Changed lines 61-62 from:
to:
Changed lines 94-95 from:
to:
Changed lines 115-116 from:
to:
Changed lines 167-168 from:
to:
Changed lines 175-176 from:

See the code of a simple sample Front Addon here: Front Hello World Addon Code

to:

See the code of a simple sample Front Addon here: Front Hello World Addon Code TOP

November 05, 2007, at 03:18 PM by austriaka -
Changed line 50 from:

Perform your PHP code, here it is the call of PHP function gmdate() making use of the $cfgrow array of Pixelpost core code. Pixelpost's core variables are always available in normal Addons. If you access them as globals they will be changed.\\

to:

Perform your PHP code, here it is the call of PHP function gmdate() making use of the $cfgrow array of Pixelpost core code. Pixelpost's core variables are always available in normal Addons. If you access them as globals they can be changed.\\

November 05, 2007, at 03:18 PM by austriaka -
Changed line 50 from:

Perform your PHP code, here it is the call of PHP function gmdate() making use of the $cfgrow array of Pixelpost core code. Pixelpost's core variables are always available. If you access them as globals they will be changed.\\

to:

Perform your PHP code, here it is the call of PHP function gmdate() making use of the $cfgrow array of Pixelpost core code. Pixelpost's core variables are always available in normal Addons. If you access them as globals they will be changed.\\

November 05, 2007, at 03:12 PM by austriaka -
Changed lines 13-14 from:

Admin Addons were invented in version 1.5. With Admin Addons you can

to:

Admin Addons were invented in version 1.5.
With Admin Addons you can

November 05, 2007, at 03:10 PM by austriaka -
Changed line 2 from:

Creating Addons is not difficult at all but you should be familiar to PHP and the Pixelpost core code. Please bear in mind that if you use Pixelpost's own variables they will be overwritten by your Addon.\\

to:

Creating Addons is not difficult at all but you should be familiar to PHP and the Pixelpost core code. Please bear in mind that if you use Pixelpost's own variables they can be overwritten by your Addon.\\

November 05, 2007, at 02:37 PM by austriaka -
Changed lines 19-20 from:

See here a list of all available Admin workspaces.

to:

See here a list of all available Admin workspaces.

Changed lines 27-28 from:

See here a list of all available Front workspaces.

to:

See here a list of all available Front workspaces.

Changed lines 57-58 from:

See the code of a simple sample "Normal" Addon here: Hello World Addon Code

to:

See the code of a simple sample "Normal" Addon here: Hello World Addon Code

Added lines 153-154:

See the code of a simple sample Admin Addon here: Admin Hello World Addon Code

Changed lines 166-168 from:
to:

Front Workspaces

See the code of a simple sample Front Addon here: Front Hello World Addon Code

November 05, 2007, at 02:22 PM by austriaka -
Added lines 57-58:

See the code of a simple sample "Normal" Addon here: Hello World Addon Code

November 05, 2007, at 11:28 AM by austriaka -
Changed lines 21-22 from:

Naming convention: admin_addonname.php

to:

Naming convention: admin_addonname.php

Changed lines 29-30 from:

Naming convention: front_addonname.php

to:

Naming convention: front_addonname.php

Changed line 40 from:

You can put them all together into a folder within the addons directory, using this naming convention: _addonfoldername

to:

You can put them all together into a folder within the addons directory, using this naming convention: _addonfoldername

Changed line 77 from:

index.php?view=menu&menuview=new_submenu\\

to:

index.php?view=menu&menuview=new_submenu\\

November 05, 2007, at 11:26 AM by austriaka -
Changed lines 3-4 from:

Tip: While testing your addon add ?errors to the address string in the URL field of your browser to show errors or change line 46 of index.php "error_reporting(0);" to "error_reporting(E_ALL ^ E_NOTICE);".

to:

Tip: To show errors while testing your addon add "?errors" to the address string in the URL field of your browser or insert "error_reporting(E_ALL ^ E_NOTICE)" in the beginning of your Addon code (remove it when finished!).

Changed line 11 from:

Naming convention: addonname.php

to:

Naming convention: addonname.php

November 05, 2007, at 11:10 AM by GeoS - corrected some PHP code
Changed line 113 from:

(:source lang=PHP -link :)add_admin_functions('', 'admin_main_menu', 'New_Page', '')

to:

(:source lang=PHP -link :)add_admin_functions('', 'admin_main_menu', 'New_Page', '');

Changed line 115 from:

(:source lang=PHP -link :)add_admin_functions('show_newpage', 'admin_main_menu_contents', 'New_Page', ''

to:

(:source lang=PHP -link :)add_admin_functions('show_newpage', 'admin_main_menu_contents', 'New_Page', '');

November 05, 2007, at 10:11 AM by austriaka -
Changed lines 156-157 from:

add_front_functions($addon_function_name, $addon_front_workspace

to:

add_front_functions($addon_function_name, $addon_front_workspace)

November 05, 2007, at 10:10 AM by austriaka -
Changed lines 94-102 from:

[@$addon_workspace = "image_edit";
// menu where the addon should appear in admin panel. in this case: images menu
$addon_menu = "images";
// What would be the title of submenu of this addon: 12cropimage
$addon_admin_submenu = "12cropimage";
// What is the function
$addon_function_name = "cropimage12_admin_addon";
// add the function\\

to:

(:source lang=PHP -link :)[@$addon_workspace = "image_edit"; // menu where the addon should appear in admin panel. in this case: images menu $addon_menu = "images"; // What would be the title of submenu of this addon: 12cropimage $addon_admin_submenu = "12cropimage"; // What is the function $addon_function_name = "cropimage12_admin_addon";

// add the function

Changed line 113 from:

(:source lang=PHP -link :)add_admin_functions('', 'admin_main_menu', 'New_Page', ''

to:

(:source lang=PHP -link :)add_admin_functions('', 'admin_main_menu', 'New_Page', '')

Changed line 115 from:

add_admin_functions('show_newpage', 'admin_main_menu_contents', 'New_Page', ''

to:

(:source lang=PHP -link :)add_admin_functions('show_newpage', 'admin_main_menu_contents', 'New_Page', ''

Changed line 117 from:

[@function show_newpage() {

to:

(:source lang=PHP -link :)[@function show_newpage() {

Changed line 127 from:
  • [@function show_newpage() {
to:
  • (:source lang=PHP -link :)[@function show_newpage() {
November 05, 2007, at 10:08 AM by austriaka -
Changed line 113 from:

(:source lang=PHP4ALT -link :)add_admin_functions('', 'admin_main_menu', 'New_Page', ''

to:

(:source lang=PHP -link :)add_admin_functions('', 'admin_main_menu', 'New_Page', ''

November 05, 2007, at 10:07 AM by austriaka -
Changed line 113 from:

add_admin_functions('', 'admin_main_menu', 'New_Page', ''

to:

(:source lang=PHP4ALT -link :)add_admin_functions('', 'admin_main_menu', 'New_Page', ''

November 05, 2007, at 10:05 AM by austriaka -
Changed line 151 from:

Writing Front Addons

to:

Writing a Front Addon

November 05, 2007, at 10:05 AM by austriaka -
Changed line 154 from:

Interface function

to:

Front Interface function

Changed lines 162-165 from:

Front Workspaces

Code Sample

This is the code for a very simple Front Addon which makes use of the front workspace 'frontpage_init'. It sets a specific category as default category

to:
November 05, 2007, at 09:46 AM by austriaka -
Added line 165:

This is the code for a very simple Front Addon which makes use of the front workspace 'frontpage_init'. It sets a specific category as default category

November 05, 2007, at 09:41 AM by austriaka -
Changed lines 66-67 from:

Interface function

To call your Addon functions in the right place you have to make use of the interface function:\\

to:

Admin Interface function

To call your Admin Addon functions in the right place you have to make use of the admin interface function:\\

Changed line 83 from:

Workspaces

to:

Admin Workspaces

Added lines 153-158:

Interface function

To call your Front Addon functions in the right place you have to make use of the front interface function:
add_front_functions($addon_function_name, $addon_front_workspace

Front Workspaces

November 05, 2007, at 09:35 AM by austriaka -
Changed lines 153-156 from:

The main reason for inventing the Front Workspaces in Pixelpost v1.7 was the demand for additional spam defeat methods. So you'll find the most front workspaces within the comments code where they can be used for spam statistics or for implementing new spam filters after the applying of Pixelpost's own spam control functions.

See the actual list of available Front Workspaces here:
Front Workspaces

to:

The main reason for inventing the Front Workspaces in Pixelpost v1.7 was the demand for additional spam defeat methods. So you'll find the most front workspaces within the comments code where they can be used for spam statistics or for implementing new spam filters after or between the applying of Pixelpost's own spam control functions.

See the actual list of available Front Workspaces here: Front Workspaces

Code Sample

November 05, 2007, at 09:14 AM by austriaka -
Added line 22:
Changed lines 149-156 from:

}@]

to:

}@]

Writing Front Addons

Front Addons work very similar to the Admin Addons. They use their own workspaces which we call Front Workspaces for differentiating.
The main reason for inventing the Front Workspaces in Pixelpost v1.7 was the demand for additional spam defeat methods. So you'll find the most front workspaces within the comments code where they can be used for spam statistics or for implementing new spam filters after the applying of Pixelpost's own spam control functions.

See the actual list of available Front Workspaces here:
Front Workspaces

November 05, 2007, at 08:50 AM by austriaka -
Changed lines 114-115 from:

add_admin_functions('show_newpage', 'admin_main_menu_contents', 'New_Page', ''

to:

add_admin_functions('show_newpage', 'admin_main_menu_contents', 'New_Page', ''

Changed lines 124-148 from:
  1. save it as admin_newpage.php in the Addons directory and try it!
to:
  1. save it as admin_newpage.php in the Addons directory and try it!
  • To add content to the new page including submenus you should use the following function:
    • function show_newpage() {
         global $pixelpost_db_prefix;
         if ($_GET['view']=='new_page']) {
            echo '<div class="caption">NEW PAGE</div>
                  <div class="submenu">';
            $submenuclass = '';
            if (!isset($_GET['new_pageview']) || $_GET['new_pageview']=='overview') {
               $submenuclass = 'selectedsubmenu';
               echo "<a href='?view=new_page&amp;new_pageview=overview' class='".$submenucssclass."' >OVERVIEW</a>\n";
            }
            $submenuclass = '';
            if ($_GET['new_pageview'=='details') {
               $submenuclass = 'selectedsubmenu';
               echo "<a href='?view=new_page&amp;new_pageview=details' class='".$submenucssclass."' >DETAILS</a>\n";
            $submenuclass = '';
            if ($_GET['new_pageview'=='settings') {
               $submenuclass = 'selectedsubmenu';
               echo "<a href='?view=new_page&amp;new_pageview=settings' class='".$submenucssclass."' >SETTINGS</a>\n";
            echo '</div>';
            echo '<div class="jcaption">Section Title</div>';
            echo '<p>This is a really new page!</p>';
         }
      }
November 05, 2007, at 08:25 AM by austriaka -
Changed line 111 from:
  1. create the new menu item\\
to:
  1. create the new menu item\\
Changed line 113 from:
  1. assign the function for echoing the new content on New Page\\
to:
  1. assign the function for echoing the new content on New Page\\
Changed line 116 from:
  1. define the function:\\
to:
  1. define the function:\\
Changed line 125 from:
  1. save it as admin_newpage.php in the Addons directory and try it!
to:
  1. save it as admin_newpage.php in the Addons directory and try it!
November 05, 2007, at 08:24 AM by austriaka -
Changed lines 109-110 from:
  • You can use multiple functions in your Addon for different places of the Admin panel, just assign them to the workspaces where they should be called.
    *To add a new page with content to the Admin panel you should perform the following steps:\\
to:
  • You can use multiple functions in your Addon for different places of the Admin panel, just assign them to the workspaces where they should be called.
  • To add a new page with content to the Admin panel you should perform the following steps:
Changed lines 124-125 from:

}@]

to:

}@]

  1. save it as admin_newpage.php in the Addons directory and try it!
November 05, 2007, at 08:23 AM by austriaka -
Changed lines 111-115 from:
  1. add_admin_functions('', 'admin_main_menu', 'New_Page', ''
    this creates the new menu item
  2. add_admin_functions('show_newpage', 'admin_main_menu_contents', 'New_Page', ''
    this assigns the function for echoing the new content on New Page
  3. [@function show_newpage() {
to:
  1. create the new menu item
    add_admin_functions('', 'admin_main_menu', 'New_Page', ''
  2. assign the function for echoing the new content on New Page
    add_admin_functions('show_newpage', 'admin_main_menu_contents', 'New_Page', ''
  3. define the function:
    [@function show_newpage() {
Changed line 124 from:

}

to:

}@]

November 05, 2007, at 08:09 AM by austriaka -
Changed lines 62-64 from:
  • You can access the variables of the Admin files inside your addon's functions.
  • If you define them as globals you can overwrite them but make sure that the core code still works.
to:
  • You can access the variables of the Admin files inside your addon's functions by defining them as globals.
  • You can overwrite them but make sure that the core code still works.
Added lines 108-122:

Coding Tips

  • You can use multiple functions in your Addon for different places of the Admin panel, just assign them to the workspaces where they should be called.
    *To add a new page with content to the Admin panel you should perform the following steps:
    #add_admin_functions('', 'admin_main_menu', 'New_Page', ''
    this creates the new menu item
  1. add_admin_functions('show_newpage', 'admin_main_menu_contents', 'New_Page', ''
    this assigns the function for echoing the new content on New Page
  2. [@function show_newpage() {
   global $pixelpost_db_prefix;
   if ($_GET['view']=='new_page']) {
      echo '<div class="caption">NEW PAGE</div>
            <div class="jcaption">Section Title</div>';
      echo '<p>This is a really new page!</p>';
   }

}

November 05, 2007, at 07:55 AM by austriaka -
Changed lines 19-20 from:

See a list of all available Admin workspaces below.

to:

See here a list of all available Admin workspaces.

Changed lines 24-26 from:

Front Addons can add extended functions within the Pixelpost code and can perform actions exactly in the moment they are called.
See a list of all available Front workspaces below.

to:

Front Addons can add extended functions within the Pixelpost code and can perform actions exactly in the moment they are called.

See here a list of all available Front workspaces.

Added line 57:
Changed lines 104-107 from:

The function crop12_admin_addon() performs the action of this addon.

to:

The function crop12_admin_addon() performs the action of this addon.

Please have a look into the code of admin_ping.php, admin_update_exif.php and admin_akismet_comment.php too!

November 05, 2007, at 07:48 AM by austriaka -
Added line 59:
  • You can create new menus and submenus by using the interface function and the correct workspace.
Added line 71:

New Menus and Submenus

Added lines 73-76:

If you want to add a new submenu to one of the original pages the link to this submenu page is automatically created as
index.php?view=menu&menuview=new_submenu
where menu is the menu variable and new_submenu is the name of your new submenu.

Changed lines 80-123 from:

If you want to add a new submenu to one of the pages the link to this submenu page is automatically created as
index.php?view=menu&menuview=new_submenu
where menu is the menu variable and new_submenu is the name of your new submenu.

List of available Admin Workspaces

Workspace NameMenuFile NameInsert Location
All Pages
admin_html_head-index.phpBetween <HTML> and </HTML> of each admin page
admin_main_menu-index.phpwhile creating the Admin menus
admin_main_menu_contents-index.phpduring the call of the submenu pages in dependence of GET variable
Options
optionsoptionsoptions.phpwhen calling the Admin Options page. Use it to create a new submenu here.
additional_spam_measures-options.phpat the end of the form in submenu Spam Control
General Info
infoinfoview_info.phpwhen calling the Admin Info page. Use it to create a new submenu here.
Comments
commentscommentscomments.phpwhen calling the Admin Comments page. Use it to create a new submenu here.
pages_commentbuttons-comments.phpafter the SQL statement which counts the entries for the page numbers
show_commentbuttons_top-comments.phpafter the buttons on top of the comments list
single_comment_list-comments.phpbefore each single comment in the list
show_commentbuttons_bottom-comments.phpafter the buttons at the bottom of the comments list
New Image
image_upload_start-new_image.phpin the beginning of file upload
image_upload_succesful-new_image.phpafter the successful upload of an image
image_upload_failed-new_image.phpafter the error message if an image upload failed
image_uploaded-new_image.phpafter the insert of the image into the database
upload_finished-new_image.phpafter the insert of the image tags into the database
new_image_form_def_lang-new_image.phpwithin the new image form (after the default language tags)
new_image_form_alt_lang-new_image.phpwithin the new image form (after the alternative language tags)
new_image_form-new_image.phpat the end of new image form, just before the submit button
thumb_created-new_image.phpafter the thumbnail creation but before the 12CropImage function
Edit Image
image_editimagesimages_edit.phpwhen calling the Admin Images Edit page. Use it to create a new submenu here.
image_update-images_edit.phpduring the image update in the database right after updating the categories
image_reupload_start-images_edit.phpin the beginning of file re-upload
image_reupload_succesful-images_edit.phpafter the successful re-upload of an image
image_reupload_failed-images_edit.phpafter the error message if an image re-upload failed
image_deleted-images_edit.phpin the beginning of image deletion
image_list-images_edit.phpwithin the list of the images after the basic information
edit_image_form_def_lang-images_edit.phpwithin the edit image form (after the default language tags)
edit_image_form_alt_lang-images_edit.phpwithin the edit image form (after the alternative language tags)
edit_image_form-images_edit.phpat the end of edit image form, just before the submit button
to:

Workspaces

Workspaces can be compared to anchors within the admin code. All addon functions must be "tied" to a workspace and are called in the moment the script passes the workspace. This way you can add new functionality into many locations of the admin files.
See the list of available Admin Workspaces here:
Admin Workspaces

November 05, 2007, at 07:35 AM by austriaka -
Changed lines 68-72 from:

Use of the Admin Interface Function

List of available Menus / Submenus

 in Pixelpost v1.7 that can be used for Admin addons:
to:

Use of the Admin Interface Function

By using the interface function you can create your own menus and submenus with Your Admin Addon.
See the list of available Menus / Submenus here: available Menus / Submenus

If you want to add a new submenu to one of the pages the link to this submenu page is automatically created as
index.php?view=menu&menuview=new_submenu
where menu is the menu variable and new_submenu is the name of your new submenu.

List of available Admin Workspaces

Deleted lines 79-100:
Menu NameMenu VariableSubmenu NameSubmenu VariableLink
New Image---index.php
OptionsoptionsGeneralgeneralindex.php?view=options&optionsview=general
OptionsoptionsTemplatetemplateindex.php?view=options&optionsview=template
OptionsoptionsThumbnailsthumbindex.php?view=options&optionsview=thumb
OptionsoptionsSpam Controlantispamindex.php?view=options&optionsview=antispam
OptionsoptionsNew Submenunew_submenuindex.php?view=options&optionsview=new_submenu
Imagesimages--index.php?view=images
ImagesimagesNew Submenunew_submenuindex.php?view=images&imagesview=new_submenu
Commentscomments--index.php?view=comments
CommentscommentsCommentspublishedindex.php?view=comments&show=published
CommentscommentsAwaiting Moderationmaskedindex.php?view=comments&show=masked
CommentscommentsAkismetakismetindex.php?view=comments&commentsview=akismet
CommentscommentsNew Submenunew_submenuindex.php?view=comments&commentsview=new_submenu
General Infoinfo--index.php?view=info
General InfoinfoNew Submenunew_submenuindex.php?view=info&infoview=new_submenu

If you want to add a new submenu to one of the pages the link to this submenu page is automatically created as
index.php?view=menu&menuview=new_submenu
where menu is the menu variable and new_submenu is the name of your new submenu.

List of available Admin Workspaces

November 05, 2007, at 07:28 AM by austriaka -
Changed lines 67-72 from:

Here are several ways to use this interface:

to:

See the several ways to use this interface here:
Use of the Admin Interface Function

List of available Menus / Submenus

 in Pixelpost v1.7 that can be used for Admin addons:
Deleted lines 73-91:
SyntaxDescription
add_admin_functions($addon_function_name,$addon_workspace,'','')
Example:
add_admin_functions('do_pings','image_uploaded','','')
The Addon function do_pings() is performed in the workspace "image_uploaded".
Here the interface is used to call an Addon function in the defined workspace. No menus or submenus are involved since every workspace has its unique location.
add_admin_functions($addon_function_name,$addon_workspace,$addon_menu,$addon_submenu)
Example:
add_admin_functions('cropimage12_admin_addon','image_edit','images','12cropimage')
Creates a new submenu named "12cropimage" under Images Menu, calling the function crop12_admin_addon() in the workspace "image_edit".
To create code within a new submenu of an existing menu you have to use the interface function with all variables set. $addon_menu should now be an existing menu item. If the submenu in $addon_admin_submenu does not exist the submenu entry is created automatically.
Special interface functions:
add_admin_functions($addon_function_name,'admin_html_head','','')Inserts code between the <HTML> and </HTML> tags in all Admin pages. Can be used for CSS, Javascript or for including files.
add_admin_functions('','admin_main_menu',$addon_menu,'')This is used to create a new menu entry in the Admin panel. The $addon_menu variable will indicate the menu name as well as the link to that new page in admin area. For instance if $addon_menu is "newitem", the link to the new page will be index.php?view=newitem and the menu title will show NEWITEM.
add_admin_functions($addon_function_name,'admin_main_menu_contents',$addon_menu,'')
With this function the content of a new page is performed whenever the new page is called. Of course $addon_menu must be the name of the new page here.
To add submenus to your new page you can code them directly in the new page code.

List of available Menus / Submenus

 in Pixelpost v1.7 that can be used for Admin addons:
November 05, 2007, at 07:22 AM by austriaka -
Changed line 108 from:

List of available Admin Workspaces

to:

List of available Admin Workspaces

Changed lines 139-142 from:
to:
image_reupload_start-images_edit.phpin the beginning of file re-upload
image_reupload_succesful-images_edit.phpafter the successful re-upload of an image
image_reupload_failed-images_edit.phpafter the error message if an image re-upload failed
image_deleted-images_edit.phpin the beginning of image deletion
image_list-images_edit.phpwithin the list of the images after the basic information
edit_image_form_def_lang-images_edit.phpwithin the edit image form (after the default language tags)
edit_image_form_alt_lang-images_edit.phpwithin the edit image form (after the alternative language tags)
edit_image_form-images_edit.phpat the end of edit image form, just before the submit button
November 05, 2007, at 07:16 AM by austriaka -
Changed lines 132-134 from:
to:
new_image_form_def_lang-new_image.phpwithin the new image form (after the default language tags)
new_image_form_alt_lang-new_image.phpwithin the new image form (after the alternative language tags)
new_image_form-new_image.phpat the end of new image form, just before the submit button
thumb_created-new_image.phpafter the thumbnail creation but before the 12CropImage function
Edit Image
image_editimagesimages_edit.phpwhen calling the Admin Images Edit page. Use it to create a new submenu here.
image_update-images_edit.phpduring the image update in the database right after updating the categories
November 05, 2007, at 07:04 AM by austriaka -
Added line 111:
All Pages
Added line 115:
Options
Added line 118:
General Info
Added line 120:
Comments
Changed lines 126-127 from:
to:
New Image
image_upload_start-new_image.phpin the beginning of file upload
image_upload_succesful-new_image.phpafter the successful upload of an image
image_upload_failed-new_image.phpafter the error message if an image upload failed
image_uploaded-new_image.phpafter the insert of the image into the database
upload_finished-new_image.phpafter the insert of the image tags into the database
November 05, 2007, at 06:57 AM by austriaka -
Changed lines 116-123 from:
to:
infoinfoview_info.phpwhen calling the Admin Info page. Use it to create a new submenu here.
commentscommentscomments.phpwhen calling the Admin Comments page. Use it to create a new submenu here.
pages_commentbuttons-comments.phpafter the SQL statement which counts the entries for the page numbers
show_commentbuttons_top-comments.phpafter the buttons on top of the comments list
single_comment_list-comments.phpbefore each single comment in the list
show_commentbuttons_bottom-comments.phpafter the buttons at the bottom of the comments list
November 05, 2007, at 06:38 AM by austriaka -
Changed lines 110-112 from:
Workspace NameMenu NameFile NameDescription
to:
Workspace NameMenuFile NameInsert Location
admin_html_head-index.phpBetween <HTML> and </HTML> of each admin page
admin_main_menu-index.phpwhile creating the Admin menus
admin_main_menu_contents-index.phpduring the call of the submenu pages in dependence of GET variable
optionsoptionsoptions.phpwhen calling the Admin Options page. Use it to create a new submenu here.
additional_spam_measures-options.phpat the end of the form in submenu Spam Control
November 05, 2007, at 06:05 AM by austriaka -
Changed line 66 from:

You don't have to use all of those parameters when calling the interface, it depends on what kind of action you want to perform.

to:

You don't have to use all of those parameters when calling the interface, it depends on what kind of action you want to perform. \\

Changed line 78 from:
Special interface functions:
to:
Special interface functions:
November 05, 2007, at 06:04 AM by austriaka -
Changed line 56 from:

Always remember that when writing an Admin Addon:\\

to:

Always remember that when writing an Admin Addon:

November 05, 2007, at 06:03 AM by austriaka -
Changed lines 13-14 from:

Admin Addons were invented in version 1.5. They add new features and new menus / submenus to the Admin area. They have to be assigned to "workspaces" in predefined places and are called by a function whithout any arguments. The addon code is included at run-time in the location of the workspace, so you can use global variables to overwrite Pixelpost's variables at exactly this moment.

to:

Admin Addons were invented in version 1.5. With Admin Addons you can

  • add new content to the forms of the Admin panel in the New Image, Edit Image, Images List, Comments, Options and Info page.
  • add new pages to the Admin panel. This adds a new menu title link in the Admin menus automatically and creates optional submenu entries.
  • also place new tags for the public pages. It is recommended to split your Addon files to have one file per Addon type (see below).

The logic behind the Admin addons is simple: Whenever one of the Admin pages is called, a list of addon functions and their assigned location (=workspace) is stored in an array. At every workspace in the core code the related functions from Admin addons are performed in run-time.

Changed lines 56-65 from:

With Admin Addons you can

  • add new content to the forms of the Admin panel in the New Image, Edit Image, Images List, Comments, Options and Info page.
  • add new pages to the Admin panel. This adds a new menu title link in the Admin menus automatically and creates optional submenu entries.
  • place new tags for the public pages. As mentioned above it is recommended to split your Addon files to have one file per Addon type.

The logic behind the Admin addons is simple: Whenever one of the Admin pages is called, a list of addon functions and their corresponding workspaces is stored in an array. At every workspace in the core code the related functions from Admin addons are called in run-time.
You can access the variables of the Admin files inside your addon's functions. If you define them as globals you can overwrite them but make sure that the core code still works.

To call your Addon functions you have to make use of the interface function:\\

to:

Always remember that when writing an Admin Addon:
*Workspaces are predefined unique locations within the core code of the admin files.

  • Your Admin Addon code must be assigned to a workspace by using the Interface function.
  • You can access the variables of the Admin files inside your addon's functions.
  • If you define them as globals you can overwrite them but make sure that the core code still works.

Interface function

To call your Addon functions in the right place you have to make use of the interface function:\\

Changed line 69 from:
SyntaxDescription
to:
SyntaxDescription
Changed lines 85-86 from:

Here is the list of available menus / submenus in Pixelpost v1.7 that can be used for Admin addons:

to:

List of available Menus / Submenus

 in Pixelpost v1.7 that can be used for Admin addons:
Added lines 108-112:

List of available Admin Workspaces

Workspace NameMenu NameFile NameDescription
November 05, 2007, at 05:41 AM by austriaka -
Changed lines 56-59 from:

The logic behind the Admin addons is simple: Whenever one of the Admin pages is called, the script looks for Admin addons in the Addons folder and updates the list of available Addons in database addons table. A list of addon functions and their corresponding workspaces is stored in an array. At every workspace in the core code the related functions from Admin addons are called in run-time.
You can access the variables of the Admin files as globals inside your addon's functions. You can overwrite them if needed but make sure that the core code still works.

to:
  • place new tags for the public pages. As mentioned above it is recommended to split your Addon files to have one file per Addon type.

The logic behind the Admin addons is simple: Whenever one of the Admin pages is called, a list of addon functions and their corresponding workspaces is stored in an array. At every workspace in the core code the related functions from Admin addons are called in run-time.
You can access the variables of the Admin files inside your addon's functions. If you define them as globals you can overwrite them but make sure that the core code still works.

November 05, 2007, at 05:38 AM by austriaka -
Changed line 43 from:

Perform your PHP code, here it is the call of PHP function gmdate() making use of the $cfgrow array of Pixelpost core code. Pixelpost's core variables are always available. if you access them as globals they will be changed.\\

to:

Perform your PHP code, here it is the call of PHP function gmdate() making use of the $cfgrow array of Pixelpost core code. Pixelpost's core variables are always available. If you access them as globals they will be changed.\\

November 05, 2007, at 05:38 AM by austriaka -
Changed line 43 from:

Perform your PHP code, here it is the call of PHP function gmdate() making use of the $cfgrow array of Pixelpost core code. You remember, most of Pixelpost's core variables are always available.\\

to:

Perform your PHP code, here it is the call of PHP function gmdate() making use of the $cfgrow array of Pixelpost core code. Pixelpost's core variables are always available. if you access them as globals they will be changed.\\

November 05, 2007, at 05:36 AM by austriaka -
Changed lines 38-39 from:
to:

Writing a "Normal" Addon

November 05, 2007, at 05:36 AM by austriaka -
Changed line 40 from:

Open the file current_datetime.php in your Addons directory and have a look at the code. This Addon is provided as a simple example how to write an addon:\\

to:

Open the file current_datetime.php in your Addons directory and have a look at the code. This Addon is provided as a simple example how to write an addon:

November 05, 2007, at 05:27 AM by austriaka -
Changed lines 56-57 from:

The logic behind the Admin addons is simple: Whenever one of the Admin pages is called, the script looks for Admin addons in the Addons folder and updates the list of available Addons in database addons table. A list of addon functions and their corresponding workspaces is stored in an array. At every workspace in the core code the related functions from Admin addons are called in run-time.

to:

The logic behind the Admin addons is simple: Whenever one of the Admin pages is called, the script looks for Admin addons in the Addons folder and updates the list of available Addons in database addons table. A list of addon functions and their corresponding workspaces is stored in an array. At every workspace in the core code the related functions from Admin addons are called in run-time.
You can access the variables of the Admin files as globals inside your addon's functions. You can overwrite them if needed but make sure that the core code still works.

Changed lines 63-64 from:

In dependence of what kind of action you want to perform, there are five ways to use this interface:

to:

You don't have to use all of those parameters when calling the interface, it depends on what kind of action you want to perform. Here are several ways to use this interface:

Changed lines 67-68 from:
add_admin_functions($addon_function_name,'admin_html_head','','')This is used to echo some HTML code between the <HTML> and </HTML> code in all Admin pages. It can be style definitions or JavaScript for example.
add_admin_functions($addon_function_name,$addon_workspace,'','')Here the interface is used to call an Addon function in the defined workspace. No menus or submenus are involved since every workspace has its own location.
to:
add_admin_functions($addon_function_name,$addon_workspace,'','')
Example:
add_admin_functions('do_pings','image_uploaded','','')
The Addon function do_pings() is performed in the workspace "image_uploaded".
Here the interface is used to call an Addon function in the defined workspace. No menus or submenus are involved since every workspace has its unique location.
Changed lines 72-74 from:
To use a new submenu within an existing menu you have to use the interface function with all variables set. $addon_menu should now be an existing menu item. If the submenu in $addon_admin_submenu does not exist the submenu entry is created automatically.
add_admin_functions('','admin_main_menu',$addon_menu,'')
This is used to create a new menu entry in the Admin panel. The $addon_menu variable will indicate the menu name as well as the link to that new page in admin area. For instance if $addon_menu is "newitem", the link to the new page will be index.php?x=newitem and the menu title will show NEWITEM.
to:

Example:
add_admin_functions('cropimage12_admin_addon','image_edit','images','12cropimage')
Creates a new submenu named "12cropimage" under Images Menu, calling the function crop12_admin_addon() in the workspace "image_edit". ||To create code within a new submenu of an existing menu you have to use the interface function with all variables set. $addon_menu should now be an existing menu item. If the submenu in $addon_admin_submenu does not exist the submenu entry is created automatically. ||

Special interface functions:
add_admin_functions($addon_function_name,'admin_html_head','','')Inserts code between the <HTML> and </HTML> tags in all Admin pages. Can be used for CSS, Javascript or for including files.
add_admin_functions('','admin_main_menu',$addon_menu,'')This is used to create a new menu entry in the Admin panel. The $addon_menu variable will indicate the menu name as well as the link to that new page in admin area. For instance if $addon_menu is "newitem", the link to the new page will be index.php?view=newitem and the menu title will show NEWITEM.
November 05, 2007, at 04:40 AM by austriaka -
Changed lines 13-15 from:

Admin Addons were invented in version 1.5. They add new features and new menus / submenus to the Admin area. They have to be assigned to "workspaces" in predefined places and called by a function. The addon code is included in the location of the workspace, so you can use global variables to overwrite Pixelpost's variables at exactly this moment.
See a list of all available workspaces below.

to:

Admin Addons were invented in version 1.5. They add new features and new menus / submenus to the Admin area. They have to be assigned to "workspaces" in predefined places and are called by a function whithout any arguments. The addon code is included at run-time in the location of the workspace, so you can use global variables to overwrite Pixelpost's variables at exactly this moment.
See a list of all available Admin workspaces below.

Changed lines 21-22 from:

See a list of all available workspaces below.

to:

See a list of all available Front workspaces below.

Changed line 58 from:

To call a function you have to make use of the interface function:\\

to:

To call your Addon functions you have to make use of the interface function:\\

Changed lines 110-112 from:

add_admin_functions($addon_function_name,$addon_workspace,$addon_menu,$addon_admin_submenu);@]

to:

add_admin_functions($addon_function_name,$addon_workspace,$addon_menu,$addon_admin_submenu);@]

The function crop12_admin_addon() performs the action of this addon.

November 05, 2007, at 04:29 AM by austriaka -
Changed lines 90-109 from:
General InfoinfoNew Submenunew_submenuindex.php?view=info&infoview=new_submenu
to:
General InfoinfoNew Submenunew_submenuindex.php?view=info&infoview=new_submenu

If you want to add a new submenu to one of the pages the link to this submenu page is automatically created as
index.php?view=menu&menuview=new_submenu
where menu is the menu variable and new_submenu is the name of your new submenu.

admin_12CropImage.php

This Addon is provided as an example for an Admin addon. Open the file and see the code:
It starts again with the $addon_ variables which every Addon must have. Like mentioned above these are $addon_name, $addon_version and $addon_description.
It should perform its function in the New Image page and create a new submenu for that.

So we call the interface function like this:
$addon_workspace = "image_edit";\\
// menu where the addon should appear in admin panel. in this case: images menu\\
$addon_menu = "images";\\
// What would be the title of submenu of this addon: 12cropimage\\
$addon_admin_submenu = "12cropimage";\\
// What is the function\\
$addon_function_name = "cropimage12_admin_addon";\\

// add the function\\
add_admin_functions($addon_function_name,$addon_workspace,$addon_menu,$addon_admin_submenu);
November 05, 2007, at 04:18 AM by austriaka -
Changed line 83 from:
ImagesimagesNew Submenunew_submenuindex.php?view=images&imagesview=new_submenu
to:
ImagesimagesNew Submenunew_submenuindex.php?view=images&imagesview=new_submenu
Changed line 88 from:
CommentscommentsNew Submenunew_submenuindex.php?view=comments&commentsview=new_submenu
to:
CommentscommentsNew Submenunew_submenuindex.php?view=comments&commentsview=new_submenu
Changed line 90 from:
General InfoinfoNew Submenunew_submenuindex.php?view=info&infoview=new_submenu
to:
General InfoinfoNew Submenunew_submenuindex.php?view=info&infoview=new_submenu
November 05, 2007, at 04:17 AM by austriaka -
Changed lines 84-87 from:
Commentscomments--index.php?view=images
to:
Commentscomments--index.php?view=comments
CommentscommentsCommentspublishedindex.php?view=comments&show=published
CommentscommentsAwaiting Moderationmaskedindex.php?view=comments&show=masked
CommentscommentsAkismetakismetindex.php?view=comments&commentsview=akismet
Added lines 89-90:
General Infoinfo--index.php?view=info
General InfoinfoNew Submenunew_submenuindex.php?view=info&infoview=new_submenu
November 05, 2007, at 04:13 AM by austriaka -
Changed line 75 from:
Menu NameMenu VariableSubmenu NameSubmenu VariableLink
to:
Menu NameMenu VariableSubmenu NameSubmenu VariableLink
Changed lines 77-81 from:
OptionsoptionsGeneralgeneralindex.php?x=options&optionsview=general
OptionsoptionsTemplatetemplateindex.php?x=options&optionsview=template
OptionsoptionsThumbnailsthumbindex.php?x=options&optionsview=thumb
OptionsoptionsSpam Controlantispamindex.php?x=options&optionsview=antispam
to:
OptionsoptionsGeneralgeneralindex.php?view=options&optionsview=general
OptionsoptionsTemplatetemplateindex.php?view=options&optionsview=template
OptionsoptionsThumbnailsthumbindex.php?view=options&optionsview=thumb
OptionsoptionsSpam Controlantispamindex.php?view=options&optionsview=antispam
OptionsoptionsNew Submenunew_submenuindex.php?view=options&optionsview=new_submenu
Imagesimages--index.php?view=images
ImagesimagesNew Submenunew_submenuindex.php?view=images&imagesview=new_submenu
Commentscomments--index.php?view=images
CommentscommentsNew Submenunew_submenuindex.php?view=comments&commentsview=new_submenu
November 05, 2007, at 03:52 AM by austriaka -
Changed line 69 from:
to:
Changed lines 71-81 from:

To add submenus to your new page you can code them directly in the new page code. ||

to:

To add submenus to your new page you can code them directly in the new page code. ||

Here is the list of available menus / submenus in Pixelpost v1.7 that can be used for Admin addons:

Menu NameMenu VariableSubmenu NameSubmenu VariableLink
New Image---index.php
OptionsoptionsGeneralgeneralindex.php?x=options&optionsview=general
OptionsoptionsTemplatetemplateindex.php?x=options&optionsview=template
OptionsoptionsThumbnailsthumbindex.php?x=options&optionsview=thumb
OptionsoptionsSpam Controlantispamindex.php?x=options&optionsview=antispam
November 05, 2007, at 03:46 AM by austriaka -
Changed lines 58-59 from:

add_admin_functions($addon_function_name, $addon_workspace, $addon_menu, $addon_admin_submenu);

to:

add_admin_functions($addon_function_name, $addon_workspace, $addon_menu, $addon_submenu);

Changed lines 63-65 from:
add_admin_functions($addon_function_name, 'admin_html_head', '', '')This is used to echo some HTML code between the <HTML> and </HTML> code in all Admin pages. It can be style definitions or JavaScript for example.
add_admin_functions($addon_function_name, $addon_workspace, '', '')Here the interface is used to call an Addon function in the defined workspace. No menus or submenus are involved since every workspace has its own location.
to:
add_admin_functions($addon_function_name,'admin_html_head','','')This is used to echo some HTML code between the <HTML> and </HTML> code in all Admin pages. It can be style definitions or JavaScript for example.
add_admin_functions($addon_function_name,$addon_workspace,'','')Here the interface is used to call an Addon function in the defined workspace. No menus or submenus are involved since every workspace has its own location.
Changed line 67 from:
to:
November 05, 2007, at 03:41 AM by austriaka -
Changed line 61 from:
to:
Changed lines 63-64 from:
add_admin_functions($addon_function_name, 'admin_html_head', '', '')
This is used to echo some HTML code between the <HTML> and </HTML> code in all Admin pages. It can be style definitions or JavaScript for example.
to:
add_admin_functions($addon_function_name, 'admin_html_head', '', '')This is used to echo some HTML code between the <HTML> and </HTML> code in all Admin pages. It can be style definitions or JavaScript for example.
November 05, 2007, at 03:40 AM by austriaka -
Changed line 61 from:
to:
Changed lines 63-64 from:
add_admin_functions($addon_function_name, 'admin_html_head', '', '')This is used to echo some HTML code between the <HTML> and </HTML> code in all Admin pages. It can be style definitions or JavaScript for example.
to:
add_admin_functions($addon_function_name, 'admin_html_head', '', '')
This is used to echo some HTML code between the <HTML> and </HTML> code in all Admin pages. It can be style definitions or JavaScript for example.
Changed lines 66-68 from:
add_admin_functions($addon_function_name, $addon_workspace, $addon_menu, $addon_admin_submenu)To use a new submenu within an existing menu you have to use the interface function with all variables set. $addon_menu should now be an existing menu item. If the submenu in $addon_admin_submenu does not exist the submenu entry is created automatically.
add_admin_functions('', 'admin_main_menu', $addon_menu, '')This is used to create a new menu entry in the Admin panel. The $addon_menu variable will indicate the menu name as well as the link to that new page in admin area. For instance if $addon_menu is "newitem", the link to the new page will be index.php?x=newitem and the menu title will show NEWITEM.
add_admin_functions($addon_function_name, 'admin_main_menu_contents', $addon_menu, '')With this function the content of a new page is performed whenever the new page is called. Of course $addon_menu must be the name of the new page here.\\
to:
add_admin_functions($addon_function_name, $addon_workspace, $addon_menu, $addon_admin_submenu)
To use a new submenu within an existing menu you have to use the interface function with all variables set. $addon_menu should now be an existing menu item. If the submenu in $addon_admin_submenu does not exist the submenu entry is created automatically.
add_admin_functions('', 'admin_main_menu', $addon_menu, '')
This is used to create a new menu entry in the Admin panel. The $addon_menu variable will indicate the menu name as well as the link to that new page in admin area. For instance if $addon_menu is "newitem", the link to the new page will be index.php?x=newitem and the menu title will show NEWITEM.
add_admin_functions($addon_function_name, 'admin_main_menu_contents', $addon_menu, '')
With this function the content of a new page is performed whenever the new page is called. Of course $addon_menu must be the name of the new page here.\\
November 05, 2007, at 03:38 AM by austriaka -
Added line 61:
November 05, 2007, at 03:33 AM by austriaka -
Deleted line 60:
Changed lines 64-66 from:
($addon_function_name, $addon_workspace, $addon_menu, $addon_admin_submenu)To use a new submenu within an existing menu you have to use the interface function with all variables set. $addon_menu should now be an existing menu item. If the submenu in $addon_admin_submenu does not exist the submenu entry is created automatically.
('', 'admin_main_menu', $addon_menu, '')This is used to create a new menu entry in the Admin panel. The $addon_menu variable will indicate the menu name as well as the link to that new page in admin area. For instance if $addon_menu is "newitem", the link to the new page will be index.php?x=newitem and the menu title will show NEWITEM.
($addon_function_name, 'admin_main_menu_contents', $addon_menu, '')With this function the content of a new page is performed whenever the new page is called. Of course $addon_menu must be the name of the new page here.\\
to:
add_admin_functions($addon_function_name, $addon_workspace, $addon_menu, $addon_admin_submenu)To use a new submenu within an existing menu you have to use the interface function with all variables set. $addon_menu should now be an existing menu item. If the submenu in $addon_admin_submenu does not exist the submenu entry is created automatically.
add_admin_functions('', 'admin_main_menu', $addon_menu, '')This is used to create a new menu entry in the Admin panel. The $addon_menu variable will indicate the menu name as well as the link to that new page in admin area. For instance if $addon_menu is "newitem", the link to the new page will be index.php?x=newitem and the menu title will show NEWITEM.
add_admin_functions($addon_function_name, 'admin_main_menu_contents', $addon_menu, '')With this function the content of a new page is performed whenever the new page is called. Of course $addon_menu must be the name of the new page here.\\
November 05, 2007, at 03:32 AM by austriaka -
Changed lines 66-68 from:
($addon_function_name, $addon_workspace, $addon_menu, $addon_admin_submenu)
to:
('', 'admin_main_menu', $addon_menu, '')This is used to create a new menu entry in the Admin panel. The $addon_menu variable will indicate the menu name as well as the link to that new page in admin area. For instance if $addon_menu is "newitem", the link to the new page will be index.php?x=newitem and the menu title will show NEWITEM.
($addon_function_name, 'admin_main_menu_contents', $addon_menu, '')With this function the content of a new page is performed whenever the new page is called. Of course $addon_menu must be the name of the new page here.
To add submenus to your new page you can code them directly in the new page code.
November 05, 2007, at 03:24 AM by austriaka -
Changed lines 58-66 from:

add_admin_functions($addon_function_name, $addon_workspace, $addon_menu, $addon_admin_submenu);

to:

add_admin_functions($addon_function_name, $addon_workspace, $addon_menu, $addon_admin_submenu);

In dependence of what kind of action you want to perform, there are five ways to use this interface:

SyntaxDescription
add_admin_functions($addon_function_name, 'admin_html_head', '', '')This is used to echo some HTML code between the <HTML> and </HTML> code in all Admin pages. It can be style definitions or JavaScript for example.
add_admin_functions($addon_function_name, $addon_workspace, '', '')Here the interface is used to call an Addon function in the defined workspace. No menus or submenus are involved since every workspace has its own location.
($addon_function_name, $addon_workspace, $addon_menu, $addon_admin_submenu)To use a new submenu within an existing menu you have to use the interface function with all variables set. $addon_menu should now be an existing menu item. If the submenu in $addon_admin_submenu does not exist the submenu entry is created automatically.
($addon_function_name, $addon_workspace, $addon_menu, $addon_admin_submenu)
November 05, 2007, at 03:03 AM by austriaka -
Added line 36:
Added line 38:
Changed lines 48-58 from:

As you can see in paged_archive.php the Addon has to repeat the "normal" pixelpost functions for showing the thumbnails in the archive page with page numbers.

to:

As you can see in paged_archive.php the Addon has to repeat the "normal" pixelpost functions for showing the thumbnails in the archive page with page numbers.

Writing an Admin Addon

With Admin Addons you can

  • add new content to the forms of the Admin panel in the New Image, Edit Image, Images List, Comments, Options and Info page.
  • add new pages to the Admin panel. This adds a new menu title link in the Admin menus automatically and creates optional submenu entries.

The logic behind the Admin addons is simple: Whenever one of the Admin pages is called, the script looks for Admin addons in the Addons folder and updates the list of available Addons in database addons table. A list of addon functions and their corresponding workspaces is stored in an array. At every workspace in the core code the related functions from Admin addons are called in run-time.

To call a function you have to make use of the interface function:
add_admin_functions($addon_function_name, $addon_workspace, $addon_menu, $addon_admin_submenu);

November 05, 2007, at 02:42 AM by austriaka -
Added lines 45-46:

Now have a closer look to the other normal Addons like calendar.php and paged_archive.php which come with your Pixelpost installation. You will see that you can call the MySQL functions as well, read out the tables and create new ones.
As you can see in paged_archive.php the Addon has to repeat the "normal" pixelpost functions for showing the thumbnails in the archive page with page numbers.

November 05, 2007, at 02:33 AM by austriaka -
Changed lines 29-30 from:
  • $addon_description: the Addon description to tell your users what it is for. The description can hold further information and a form for the settings.
to:
  • $addon_description: the Addon description to tell your users what it is for. The description can hold further information and a form for the settings.
    If you are inventing new template tags you should describe them here too.
Added line 34:
  • Always comment your Addon code so other users can understand what you were doing.
Added lines 36-44:

Writing a "Normal" Addon

Open the file current_datetime.php in your Addons directory and have a look at the code. This Addon is provided as a simple example how to write an addon:
!!!!current_datetime.php It starts with the $addon_ variables which every Addon must have. Like mentioned above these are $addon_name, $addon_version and $addon_description.
Perform your PHP code, here it is the call of PHP function gmdate() making use of the $cfgrow array of Pixelpost core code. You remember, most of Pixelpost's core variables are always available.
Replace your result with a template tag ($tmp variable is available too, it is always the one of the template that is in use right now).
Add your new template tag to the template where you want to show the new value.
That's all!

November 05, 2007, at 02:22 AM by austriaka -
Changed lines 9-10 from:

Normal Addons cannot make use of any existing template tags, but can call functions and variables. If you want to realize a different behaviour of Pixelpost, you usually have to rewrite the functions to your needs.

to:

Addons cannot make use of any existing template tags, but can call functions and variables. If you want to realize a different behaviour of Pixelpost, you usually have to rewrite the functions in your Addon.

Changed line 13 from:

Admin Addons were invented in version 1.5 and add new features and new menus / submenus to the Admin area. They have to be assigned to "workspaces" in predefined places and called by a function. The addon code is included in the location of the workspace, so you can use global variables to overwrite Pixelpost's variables at exactly this moment.\\

to:

Admin Addons were invented in version 1.5. They add new features and new menus / submenus to the Admin area. They have to be assigned to "workspaces" in predefined places and called by a function. The addon code is included in the location of the workspace, so you can use global variables to overwrite Pixelpost's variables at exactly this moment.\\

Changed lines 19-20 from:

Front Addons can add extended functions within the Pixelpost code and make use of variables and functions in the moment they are called.

to:

Front Addons can add extended functions within the Pixelpost code and can perform actions exactly in the moment they are called.
See a list of all available workspaces below.

Added lines 31-32:
  • To keep the files neat you should not mix the Addon types in one addon file. Create one Addon file for each addon type you are using.
    You can put them all together into a folder within the addons directory, using this naming convention: _addonfoldername
November 05, 2007, at 02:12 AM by austriaka -
Changed lines 21-30 from:

Naming convention: front_addonname.php

to:

Naming convention: front_addonname.php

For all these Addons you have to follow a few rules right in the beginning:

  • Strictly hold on the naming convention mentioned above
  • Always include the $addon_* variables in the beginning of the code. These are displayed in the Admin panel Addons page:
    • $addon_name: the compelling name of your Addon
    • $addon_version: the version number of your Addon
    • $addon_description: the Addon description to tell your users what it is for. The description can hold further information and a form for the settings.
  • Never change the core files of Pixelpost. Almost everything can be done with one of the Addon types: always try to keep the Pixelpost code clean.
  • If you really need a new workspace you can add it but you should better tell it to the developer team so we can include it in the next version.
November 05, 2007, at 02:04 AM by austriaka -
Added lines 4-21:

Since version 1.7 there are three types of Addons and you must know the difference between them to make use of the whole Addons functionality.

"Normal" Addons

Normal Addons add new features to the visitor's side of the blog. They can create their own template tags which show new values on the pages. These Addons are called in the index.php in the pixelpost root directory, so their functions are available in all public pages.
Normal Addons cannot make use of any existing template tags, but can call functions and variables. If you want to realize a different behaviour of Pixelpost, you usually have to rewrite the functions to your needs.

Naming convention: addonname.php

Admin Addons

Admin Addons were invented in version 1.5 and add new features and new menus / submenus to the Admin area. They have to be assigned to "workspaces" in predefined places and called by a function. The addon code is included in the location of the workspace, so you can use global variables to overwrite Pixelpost's variables at exactly this moment.
See a list of all available workspaces below.

Naming convention: admin_addonname.php

Front Addons

Front Addons are new in version 1.7. They behave similiar to the Admin Addons but their workspaces are defined within the front pages code. The code is again included when the workspace is parsed.
Front Addons can add extended functions within the Pixelpost code and make use of variables and functions in the moment they are called.

Naming convention: front_addonname.php

November 05, 2007, at 01:39 AM by austriaka -
Added lines 2-3:

Creating Addons is not difficult at all but you should be familiar to PHP and the Pixelpost core code. Please bear in mind that if you use Pixelpost's own variables they will be overwritten by your Addon.
Tip: While testing your addon add ?errors to the address string in the URL field of your browser to show errors or change line 46 of index.php "error_reporting(0);" to "error_reporting(E_ALL ^ E_NOTICE);".

October 25, 2007, at 02:23 PM by austriaka -
Added line 1:

Creating Addons


Page last modified on December 07, 2007, at 04:14 AM