Pixelpost mod: Edit image link


As my pixelpost photoblog is growing by the day, it is pretty painful to edit info for images that are a little old. In the admin page, go to the images section, then navigate a couple pages to find the image from the small thumbnail then click edit. Too much work for me. A simple tag expansion should solve this.

So I made this new tag and inserted it right after the Admin link in the footer page (my template is theworldin35mm):

<EDIT_IMAGE_LINK_ITEM>

And then the following piece of code in index.php to ensure expansion of the tag only on a image page and when logged in:

  1. if($image_id && isset($_SESSION["pixelpost_admin"])) {
  2.   $edit_image_link_item = "<li><a href=\"<SITE_URL>admin/index.php?view=images&id=$image_id\" title=
  3.     \"Edit Image\">Edit Image</a></li>";
  4.   $tpl = ereg_replace("<edit_image_link_item>",$edit_image_link_item,$tpl);
  5. } else {
  6.    $tpl = ereg_replace("</edit_image_link_item><edit_image_link_item>","<!– Edit image link only for image page when logged in –>",$tpl);
  7. }

The above code goes right after the following block:

  1. if(!isset($_GET[‘x’])) {
  2.    
  3. }

Image management (editing category/tags) is a breeze now.

  1. No comments yet.
(will not be published)