Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
Posted By: mvpetrovich=========plog-functions.php=========This has been picked up in the SVN. The full function code is now:
This needs to be updated so the picture can be found.
function plogger_get_source_picture_url() {
global $config;
// -------- Added Two lines below -----------------
$RL = strlen($_SERVER['DOCUMENT_ROOT']);
$FOLDER = substr(dirname(__FILE__),$RL);
// -------- Change the Return Value to use folder based on running file not the Config[baseurl] -------
// return (!empty($config['allow_fullpic'])) ? $config["baseurl"].'images/'.SmartStripSlashes($GLOBALS["current_picture"]["path"]) : "#";
return (!empty($config['allow_fullpic'])) ? $FOLDER.'/images/'.SmartStripSlashes($GLOBALS["current_picture"]["path"]) : "#";
}
function plogger_get_source_picture_url() {
global $config;
return (!empty($config['allow_fullpic'])) ? $config['gallery_url'].'images/'.SmartStripSlashes($GLOBALS["current_picture"]["path"]) : "#";
}
Posted By: mvpetrovichfunction plogger_album_picture_count() {This has also been picked up. The updated code reads:
if(empty($GLOBALS["current_album"])) return 0; // ---- Modified by adding this line, else error occur when no current_album
. . .
}
function plogger_album_picture_count() {
if (isset($GLOBALS['current_album'])) {
$row = $GLOBALS['current_album'];
// XXX: surely this can be optimized?
$numquery = "SELECT COUNT(*) AS `num_pictures` FROM `".TABLE_PREFIX."pictures` WHERE `parent_album`='".$row['id']."'";
$numresult = run_query($numquery);
return mysql_result($numresult, 'num_pictures');
} else {
return 0;
}
}
Posted By: mvpetrovich==========plog-globals.php=========Nice catch! It looks like this would only be a problem if the php.ini variable 'session.auto_start' is set to true, but your code should work regardless if 'session.auto_start' is set to 'false' or 'true'. I'll go ahead and change this in the SVN for the next release.
Before starting a session, you need to check to see if a session has already started. If you have an authentication system, you probably already have it started.
So, this line needs to be modified:
//if (!headers_sent())
if (!headers_sent() and !session_id())
{
session_start();
};
Posted By: mvpetrovich==========plog-comment.php==========Currently, this is somewhat fixed in the SVN, but needs more work. The updated code is:
You need to properly redirect to YOUR page when placing comments. Add this line before then header redirect.
$redirect = $_SERVER['HTTP_REFERER']; //------ added --------
header("Location: $redirect");
$redirect = str_replace("&","&",generate_url("picture",$parent_id, array(), true));
// XXX: SLOPPY fix - need more work!
$redirect = str_replace("plog-comment.php", "", $redirect);
However, your code works, but sometimes HTTP_REFERRER does not work the way you would expect (some programs like Norton Internet Security strip the HTTP_REFERRER global). It needs some more work, but I would hesitate to use HTTP_REFERRER for everyone (I know it works for you, but it may not work for everyone).
//--------- Added to process comments --------
if (!empty($_POST['comment_post_ID'])) {
include PLOGGER_DIR.'plog-process-comment.php';
}
<?php
//Created this file from plog-comment.php to be called directly from gallery.php
// this is our comment script, it simply writes the comment information
// to our flat-file database and links it to the picture using the pictures id.
$parent_id = intval($_POST["parent"]);
// -------- get the URL ---------
if(!empty($_POST['url'])) {
if (preg_match('#^http\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $_POST['url'])) {
$url = $_POST['url'];
}
elseif (preg_match('#^[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $_POST['url'])) {
$url = 'http://'.$_POST["url"];
}
else {
$url = '';
}
} else {
$url = '';
}
// If the captcha is required, check it here
if ($_SESSION['require_captcha'] == true) {
if (($_POST['captcha'] != $_SESSION['captcha']) || !$_POST['captcha']) {
$_SESSION["comment_post_error"] = "CAPTCHA check failed!";
return; // exit further processing of this file
}
}
$rv = add_comment($parent_id,$_POST["author"],$_POST["email"],$url,$_POST["comment"]);
if (!empty($rv["errors"])) {
$_SESSION["comment_post_error"] = $rv["errors"];
} elseif ($config['comments_moderate']) {
$_SESSION["comment_moderated"] = 1;
}
?>
<form action="' . htmlentities($_SERVER['REQUEST_URI']) . '" method="post" id="commentform">
if ($config["comments_moderate"] == 1) {
$approved = 0;
$notify_msg = " (awaiting your approval)";
} else {
$approved = 1;
$notify_msg = ''; // --- ADDED, to prevent error
}
function plogger_get_picture_caption() {
if (!empty($GLOBALS["current_picture"]["caption"]))
return htmlspecialchars(SmartStripSlashes($GLOBALS["current_picture"]["caption"])); // ----- added htmlspecialchars
else
return " ";
}
1 to 7 of 7