Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthornicko
    • CommentTimeMay 1st 2008
     
    I'm also new to plogger and have just downloaded and installed version 3 - look great.

    I also get many PHP Notices for Undefined Variables & Undefined Index.

    I hope this can be resolved in future realeases as agreed all variable should be defined. For now I guess I need to add: error_reporting(E_ALL); to your scripts.
  1.  
    Hi,

    I am working through looking for issues. I'm new to PHP so, I find it useful to keep the notices displayed as they catch loads of the simple bugs I miss, I'm happy to find them and clean up these as I find them as long as someone can add them to the trunk for me:

    plog-functions.php: line 1161:

    if ($config["comments_moderate"] == 1) {
    $approved = 0;
    $notify_msg = " (awaiting your approval)";
    } else {
    $approved = 1;
    $notify_msg = '';
    }

    Is this the best place to post them? Would you rather I add a bug for each one?

    Thanks,

    Mark
  2.  
    Here are a couple more:

    Plog_manage.php:
    ---------------------

    From:

    function generate_albums_menu($albums) {
    $output .= '<select name="group_id">';


    To

    function generate_albums_menu($albums) {
    $output = '<select name="group_id">';

    From

    function generate_move_menu($level) {

    if ($level == "albums") $parent = "collections";

    to

    function generate_move_menu($level) {
    $output = '';

    if ($level == "albums") $parent = "collections";


    plog_admin_functions.php
    -------------------------------

    from:
    function plog_picture_manager($id,$from,$limit) {
    plogger_init_pictures(array(
    to:
    function plog_picture_manager($id,$from,$limit) {
    $output = '';
    plogger_init_pictures(array(
  3.  
    Add
    $output = '';

    before
    // Check if update has been clicked, handle erroneous conditions, or upload

    in plog-upload.php (line 40)
  4.  
    Update admin/plog-upload.php:

    function generate_albums_menu($albums) {
    $output = '<select name="albums_menu" onclick="var k=document.getElementsByName(\'destination_radio\');k[0].checked=true;">';
    foreach($albums as $album_id => $album) {

    $selected = "";

    // If we are on the current album then set it to be the default option
    if (isset($_REQUEST["albums_menu"]) && isset($_REQUEST["new_album_name"]))
    if ($_REQUEST["albums_menu"] == $album_id || $_REQUEST["new_album_name"] == $album['album_name'])
    $selected = " selected='selected'";

    $output .= "<option value=\"".$album_id."\"$selected>";
    $output .= SmartStripSlashes($album['collection_name'])." : ".SmartStripSlashes($album['album_name'])."" ;
    $output .= "</option>";
    }

    $output .= "</select>";

    return $output;
    }
  5.  
    Add the following to line 1353 in admin/plog-admin-functions.php:

    $output = '';
  6.  
    Line 39 of admin/plog-feedback.php:

    if (isset($_REQUEST['delete_checked']) || (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete_checked')) {
  7.  
    Line 59 of admin/plog-feedback.php:

    if (isset($_REQUEST['approve_checked']) || (isset($_REQUEST['approve_checked']) && $_REQUEST['action'] == 'approve_checked')) {
  8.  
    Line 238 of admin/plog-feedback.php:

    $output .= "<td><p id=\"comment-$key-" . $row['id'] ."\">$value&nbsp;</p></td>";
  9.  
    admin\plog-themes.php:

    Line 30: $output = "<h1>" . plog_tr("Manage Themes") . "</h1>";
    Line 39: if (isset($_REQUEST["activate"])) { // activate new theme by setting configuration dir
    Line 92: $output .= "<td><a href=\"${_SERVER['PHP_SELF']}?activate=$theme_folder_basename\">" . plog_tr('Activate') . "</a></td>";

    I'm not sure what line 32 is meant to be doing, but I've removed it:

    $output .= "<p>$theme_url</p>";
  10.  
    plog-rss.php:

    Change the end to. Line 133:

    if (isset($query_parts["searchterms"])) {
    generate_RSS_feed($level, $id, $query_parts["searchterms"]);
    } else {
    generate_RSS_feed($level, $id);
    }
  11.  
    plog-comment.php:

    Line 52 onwards:

    // redirect back to picture page
    if (isset($rv["errors"])) {
    // will this work?
    $_SESSION["comment_post_error"] = $rv["errors"];
    }
    else if ($config['comments_moderate']) {
    $_SESSION["comment_moderated"] = 1;
    }
    header("Location: $redirect");
  12.  
    Line 35 of admin/plog-manage.php:

    $output = '<input class="submit" type="submit" name="move_checked" value="' . plog_tr("Move Checked To") . '"/>';

    FROM

    $output .= '<input class="submit" type="submit" name="move_checked" value="' . plog_tr("Move Checked To") . '"/>';




    Lines 1267-1268 of admin/plog-functions.php:

    function plog_album_manager($id,$from,$limit) {
    $output = '';
  13.  
    Lines 1171-1172 of admin/plog-functions.php:

    function plog_picture_manager($id,$from,$limit) {
    $output = '';


    Update admin/plog-manage.php to have the follwoing method to replace the existing one:

    function generate_albums_menu($albums) {
    $output = '<select name="group_id">';

    foreach($albums as $album_id => $album) {
    $selected = "";

    if (isset($_REQUEST["albums_menu"]) && $_REQUEST["albums_menu"] == $album_id )
    $selected = " selected";

    if (isset($_REQUEST["new_album_name"]) && $_REQUEST["new_album_name"] == $album['album_name'])
    $selected = " selected";

    $output .= "<option value=\"".$album_id."\"$selected>";
    $output .= SmartStripSlashes($album['collection_name'])." : ".SmartStripSlashes($album['album_name'])."" ;
    $output .= "</option>";
    }

    $output .= "</select>";
    return $output;
    }
  14.  
    Small issue with the latest code from:

    in plog-funtions.php, update the following methods:

    function plogger_get_next_picture_link() {
    $next_url = plogger_get_next_picture_url();
    global $config;

    if ($next_url)
    if ($config["embedded"] == 0) {
    $next_link = '<a id="next-button" accesskey="." href="'.$next_url.'#prev-button">' . plog_tr('Next') . ' &raquo;</a>';
    } else {
    $next_link = '<a id="next-button" accesskey="." href="'.$next_url.'">' . plog_tr('Next') . ' &raquo;</a>';
    }
    else
    $next_link = '';

    return $next_link;
    }

    function plogger_get_prev_picture_link() {
    $prev_url = plogger_get_prev_picture_url();
    global $config;

    if ($prev_url)
    if ($config["embedded"] == 0) {
    $prev_link = '<a id="prev-button" accesskey="," href="'.$prev_url.'#next-button">&laquo; ' . plog_tr('Previous') . '</a>';
    } else {
    $prev_link = '<a id="prev-button" accesskey="," href="'.$prev_url.'">&laquo; ' . plog_tr('Previous') . '</a>';
    }
    else
    $prev_link = '';

    return $prev_link;


    }

    as they were missing the global $config; lines.
    •  
      CommentAuthorsidtheduck
    • CommentTimeMay 8th 2008 edited
     
    Thanks for posting, MSummerville! I was actually working on this as well (but then left for vacation). I'll check to make sure I caught all of the instances that you did.

    EDIT: checked and I've now picked up all of yours (some I had already picked up, but was missing others you caught, plus I found a couple more). There is one or two more that I just noticed as well, so I'll fix those and then add to the trunk today. Thanks again!
    •  
      CommentAuthorsidtheduck
    • CommentTimeMay 8th 2008
     
    I added them all to the SVN trunk now (r536). Take a look, test, and see if any more show up. Thanks again for your help, MSummerville!
  15.  
    No problem - am more than happy to help. I really like plogger and like the clean design, good work.

    Brilliant - thanks very much for adding these to SVN. Much appreciated. I've found one more this morning that occurs when you subscribe to an RSS feed from the root collection. To fix, I changed line 1413 of plog-functions.php to:

    $value = (isset($arr['value']) && ($arr['value'] > 0)) ? $arr['value'] : -1;


    I've downloaded and merged r536 and all looks good. I think the problems that I've raised about pagination have gone away too, but it might be worth having a look at these again if people report issues with large galleries, or large numbers of albums.

    Thanks again,

    Mark
    •  
      CommentAuthorsidtheduck
    • CommentTimeMay 9th 2008 edited
     
    Nice! I've added the new missing index to my code (plus I found a few more on the RSS especially with mod_rewrite on). I'll wait until the end of the day to commit in case we find some more. That way I'll add them all at once.

    ETA: I added all the additional instances I found plus yours to the SVN trunk (r538). I'll keep the ticket open in case we run into any other ones, but all the obvious ones that I could find are now fixed.