View Full Version : Troubles with category archives...
doffer
04-10-2005, 09:23 PM
I upgraded today, to the new version of pixelpost... I followed the instructions properly, but got an error saying: lost connection to the database while prosessing the query, or something like that.
Everything worked fine, even thoug i had to use a MD5 encryptor and put the encrypted password into the "pixelpost_config" table in the DB. After that everything worked out for me, and no further problems occured.
But something is wrong with the archives. The categories ain't working properly, and the only thing that works in the archive right now is the date-based sorting of the thumbs.
If some one of you guys could tell me what to do, or maybe take a look at it it would have been fantastic. The address is http://doffer.net/index.php?x=browse.
I've only used pixelpost for a few weeks, but I'm falling deeper and deeper in love :)
Cheers for the new pixelpost, v. 1,4! :D
raminia
04-10-2005, 09:32 PM
the worst thing in installation process is losing connection to db in some how. how did you get this bad chance?!
in which part of installation it did say that?
I should look at your case more, tomorrow when I get some sleep.
aswilliamson
04-11-2005, 03:44 AM
update went perfect with me, theres just a little bug with <BROWSE_CATEGORIES_PAGED> which causes it not to work.
http://www.andrewwilliamson.info/index.php?x=browse&archivedate=&pagenum=1
everything else I use with page-by-page archive works perfectly
blinking8s
04-11-2005, 06:21 AM
try the download here:
http://www.pixelpost.org/forum/viewtopic.php?t=814
tell me if that works ok
raminia
04-11-2005, 07:54 AM
I don't see any bug there. working fine in your site also.
doffer
04-11-2005, 04:54 PM
Strange :s It ain't working here... I'll try a reinstall and delete the old stuff... Hopefully it'll work then...
doffer
04-11-2005, 05:22 PM
Archives still not working properly, after reinstall and database restore from backup and update to 1.4...
At least I didn't get the lost connection error, which is a good thing :)
At the gallery i don't understand you ramina. You said it worked, right? So you saw the pictures when clicking on the category links?
Before the reinstall I didn't have no category image counter at the right of the category name, and that showed after the reinstall.
But the images, which is the importat thing on a photoblog, still ain't there...
blinking8s
04-11-2005, 05:39 PM
weird, nothing shows up...my install works fine
does it do this with all the templates? I dont think that this is a bug, so I am moving it to the support section.
doffer
04-11-2005, 05:48 PM
All the templates... No errors showed either... I guess the MySQL-part is OK, since the update went on without errors...
The php might containt minor errors, but most likely no major mistakes, since that shows pretty clear.
blinking8s
04-11-2005, 06:18 PM
I doubt its the php, no one else has had this error that I know of...
doffer
04-11-2005, 06:27 PM
You'va got any kind of idea what the problem might be about?
doffer
04-11-2005, 06:40 PM
Maybe it's about me doing a lot of future posts?
raminia
04-11-2005, 07:36 PM
for debug add
echo $name;
to the line 252 of the paged_archive.php addon to became like this:
while(list($id,$title,$name) = mysql_fetch_row($query)) {
echo $name;
and add
echo $query;
to the line 245 of the addon to become like this
}// end else if ($_GET['archivedate']=="")
echo $query;
$query = mysql_query($query);
and report what happens when you browse archive
raminia
04-11-2005, 07:45 PM
as I see the monthly archive works
http://doffer.net/index.php?x=browse&archivedate=2005-04&monthname=April,%202005&pagenum=1
I think the problem is with the categories. I does not show categories correctly and maybe the catassoc table is not created properly.
do you have any image with multi category? if not upload one or edit one. does it mention the multi-categories correctly on the main site?
doffer
04-11-2005, 08:40 PM
I tried what you say; to assign to categories for a picture, which works fine. You can see at http://doffer.net/index.php?showimage=61. The categories appears as thay are supposed to.
raminia
04-11-2005, 09:10 PM
do what I post before for debugging.
raminia
04-11-2005, 09:18 PM
did you check timezone and date time of your postings? is it OK for you?
doffer
04-12-2005, 08:40 AM
I've done the debuging as instructed by you now, and a lot of text appears at the top of the archive page.
When clicking one of the categories this appears:
select t1.id,t1.headline,t1.image from pixelpost_pixelpost as t1 inner join pixelpost_catassoc as t2 where (t1.datetime<='2005-04-12 10:40:17') and (t2.cat_id ='7') and t1.id = t2.image_id group by t1.id order by t1.datetime desc limit 0 , 250 Some of the numbers change when clicking a different category, but it's almost the same.
When clicking a date link, it shows this:
select id,headline,image from pixelpost_pixelpost where (datetime<='2005-04-12 10:41:36' and datetime >='2005-03-01 00:00:00' and datetime <= '2005-03-31 23:59:59') order by datetime desc limit 0 , 250 gang.jpgvassfaret.jpghardangervidda.jpgfemunden.jp gfiskekniv.jpgplaza.jpgstearinlys.jpgrosa ruler.jpgtelefon kiosk.jpgskala solnedgang.jpggull busken.jpglilla-himmel.jpgevil-twin-frisor.jpgblomst-i-sno.jpgbla-dis.jpgerik hoppla.jpgglassfusion.jpglilje.jpggul-blomst.jpgkrakow_statue.jpg
raminia
04-12-2005, 08:56 AM
pretty strange!
everything seems to be ok in the debugging report!
append line 259 with
echo $thumb_output;
to become like this
} //end while
echo $thumb_output;
// initialize page counter
$pagecounter=0;
and see the result.
raminia
04-12-2005, 08:58 AM
sorry! something is obviously wrong!!!!
not normal in category archive. it should show the image name in both category and monthly archive!
Anonymous
04-12-2005, 09:08 AM
I tried to find the line you told me to but couldn't find it...
My doc looks like this:
<?php
/*
Requires Pixelpost version 1.4
Page-By-Page-Archive
ADDON-Version 0.6
Written by: Ramin Mehran
Contact: raminia@yahoo.com
Pixelpost www: http://www.pixelpost.org/
License: http://www.gnu.org/copyleft/gpl.html
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
================================================== ==========================
NEW TAGS:
<CATEGORY_LINKS_AS_LIST> // Category links as a text list for default PP's archive page
<CATEGORY_LINKS_AS_LIST_PAGED> // Category links as a text list for page-by-page archive
<BROWSE_MONTHLY_ARCHIVE_PAGED> // Monthly drop box for default PP's archive page
<BROWSE_MONTHLY_ARCHIVE_AS_LINK_PAGED> // Monthly links as a text list for page-by-page archive
<BROWSE_CATEGORIES_PAGED> // Category drop box for page-by-page archive
<THUMBNAILS_WHOLE_PAGED> // Thumbnails in this page
<THUMBNAILS_PAGES_LINKS> // Link to the pages of thumbnail in the selected category
<ARCHIVE_PAGES_NUM> // Page number you are viewing
<CATEGORY_OR_DATE_NAME_PAGED_ARCHIVE> // Name of the category or Month you select
<LINK_TO_PAGED_ARCHIVE> // Link to Paged-by-page archive page as <a href="index.php?x=browse&pagenum=1">Archive</a>',$tpl);
*/
$addon_name = "Page-By-Page-Archive for category and month (for PP v1.4)";
$addon_version = "0.6";
$maxpthumb = $cfgrow['maxpthumb'];
if ($_GET['updatedflagp']=="1")
{$isupdated = "<font color='#FF0000'>Updated!</font>";}
else
{$isupdated = ""; }
// FIELD_EXISTS
// Checks whether specified field exists in current or specified table.
$fieldname = "maxpthumb";
$table = $pixelpost_db_prefix ."config";
$fieldexists = 0;
$t = 0;
$attention_call = "";
if ($table != "") {
if ($table_name != "") $current_table = $table;
$result_id = mysql_list_fields( $pixelpost_db_pixelpost, $table );
for ($t = 0; $t < mysql_num_fields($result_id); $t++) {
if (strtolower( $fieldname) == strtolower(mysql_field_name($result_id, $t))) {
$fieldexists = 1;
break;
}
}
}
// if the field does not exit: Create it!
if ($fieldexists==0) {
$result = mysql_query("ALTER TABLE $table ADD `maxpthumb` VARCHAR( 5 ) DEFAULT '100' NOT NULL ");
}
// if the maximum number of thumbnails in the admin section is updated
if($_GET['x'] == "maxpthumb") {
$newmaxpthumb = $_POST['newmaxpthumb'];
$query = "update ".$pixelpost_db_prefix."config set maxpthumb='" .$newmaxpthumb ."'" ;
$update = mysql_query($query );
$to = './admin/?view=addons&amp;updatedflagp=1';
header('Location: '. $to);
exit;
};
// description
$addon_description = "$attention_call Page by page category and month archive. Usefull when you have
plenty of photos in archive and you want to show them in few pages and not just as a whole. Compatible with Pixelpost version 1.3 with multi category mod and version 1.4.
Many new tags is added to handle the archives. Open the archive_page.php file to see the new tags.<p />
Enter the maximum number of thumbnails in each page of the archive page:
<form method='post' action='../index.php?x=maxpthumb'>
<input type='text' name='newmaxpthumb' value='".$maxpthumb ."' style='width:40px'>
<input type='submit' value='update'>
</form> $isupdated
";
// date time of now!
$tz = $cfgrow['timezone'];
$datetime = gmdate("Y-m-d H:i:s",gmdate("U")+(3600 * $tz));
// get maximum number of thumbnails in each browse page from db
$maxnumber_thumbs = $cfgrow['maxpthumb'];
// number of all photos
$photonumb = mysql_query("select count(*) as count from ".$pixelpost_db_prefix."pixelpost where datetime<='$datetime'" );
$row = mysql_fetch_array($photonumb);
// number of photos in the database
$pixelpost_all_photonumb = $row['count'] ;
//-------------------------------- Category Browse Menu (paged and original)
/*---------------------------------**********************---------------------------------------*/
$count= $pixelpost_all_photonumb;
$category_Link_List = " <a href='index.php?x=browse'> $lang_browse_all (" .$count .") </a><br>";
$category_Link_List_paged = " <a href='index.php?x=browse&amp;pagenum=1'> $lang_browse_all (" .$count .") </a><br>";
$query = mysql_query("select * from ".$pixelpost_db_prefix."categories order by name");
while(list($id,$name) = mysql_fetch_row($query)) {
$queryr = "select count(*) as count,datetime
from {$pixelpost_db_prefix}catassoc as t1
inner join {$pixelpost_db_prefix}pixelpost t2 on t2.id = t1.image_id
where (t1.cat_id = '".$id."' AND datetime<='$datetime')
group by t1.cat_id ";
$count = mysql_query($queryr);
$count = mysql_fetch_array($count);
$count= $count['count'];
$name = pullout($name);
$catname_count = $name ." (" .$count .")";
$category_Link_List .= "<a href='index.php?x=browse&amp;category=$id'>$catname_count</a><br>";
// paged version of the browse archive
$category_Link_List_paged .= "<a href='index.php?x=browse&amp;category=$id&amp;page num=1'>$catname_count</a><br>";
}
// tags of Category List Of Links (default version)
$tpl = str_replace("<CATEGORY_LINKS_AS_LIST>",$category_Link_List,$tpl);
// paged version tages
$tpl = str_replace("<CATEGORY_LINKS_AS_LIST_PAGED>",$category_Link_List_paged,$tpl);
//----------- Monthly Archive Menu and List
if ($_GET['pagenum'] != "") {
$tz = $cfgrow['timezone'];
$thismonth = gmdate("Y-m",gmdate("U")+(3600 * $tz));
$select_display_thismonth=date("F, Y",strtotime($thismonth."-01"));
$archive_select = "<select name='browse' onChange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>Monthly archive</option><option value='index.php?x=browse&amp;archivedate=$thedate &amp;pagenum=1'>$lang_browse_all (" .$pixelpost_all_photonumb .")</option>";
$archive_select_links = "Monthly archive: <br><a href='index.php?x=browse&amp;archivedate=$thedate& amp;pagenum=1'>$lang_browse_all (" .$pixelpost_all_photonumb .")</a>";
$query = "select distinct DATE_FORMAT(datetime, '%Y-%m') from ".$pixelpost_db_prefix."pixelpost
where DATE_FORMAT(datetime, '%Y-%m') <= '$thismonth'
order by datetime desc";
$query = mysql_query($query);
while(list($thedate) = mysql_fetch_row($query)) {
$query2 = "select count(*) as count from ".$pixelpost_db_prefix."pixelpost
where DATE_FORMAT(datetime, '%Y-%m')='".$thedate ."'";
$count = mysql_query($query2);
$count = mysql_fetch_array($count);
$count= $count['count'];
$select_display_date=date("F, Y",strtotime($thedate."-01"));
$thedate = pullout($thedate);
$archive_select .= "<option value='index.php?x=browse&amp;archivedate=$thedate &amp;monthname=$select_display_date&amp;pagenum =1'>$name (" .$select_display_date .") (" .$count .")</option>";
$archive_select_links .= "<br><a href='index.php?x=browse&amp;archivedate=$thedate& amp;monthname=$select_display_date&amp;pagenum=1'>$name (" .$select_display_date .") (" .$count .")</a>";
};// end while
$archive_select .= "</select>";
} // end $_GET['pagenum'] != "")
ELSE
{
// does not use page number
$tz = $cfgrow['timezone'];
$thismonth = gmdate("Y-m",gmdate("U")+(3600 * $tz));
$select_display_thismonth=date("F, Y",strtotime($thismonth."-01"));
$archive_select = "<select name='browse'
onChange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>Monthly archive</option><option value='index.php?x=browse&amp;archivedate=$thedate &amp;pagenum=1'>$lang_browse_all (" .$pixelpost_all_photonumb .")</option>";
$archive_select_links = "Monthly archive:<br><a href='index.php?x=browse&amp;archivedate=$thedate& amp;pagenum=1'>$lang_browse_all (" .$pixelpost_all_photonumb .")</a>";
$query = mysql_query("select DISTINCT DATE_FORMAT(datetime, '%Y-%m') from ".$pixelpost_db_prefix."pixelpost order by datetime desc");
while(list($thedate) = mysql_fetch_row($query)) {
$query3 = "select count(*) as count from ".$pixelpost_db_prefix."pixelpost where DATE_FORMAT(datetime, '%Y-%m')='".$thedate ."'";
$count = mysql_query($query3);
$count = mysql_fetch_array($count);
$count= $count['count'];
$select_display_date=date("F, Y",strtotime($thedate."-01"));
$thedate = pullout($thedate);
$archive_select .= "<option value='index.php?x=browse&amp;archivedate=$thedate '>$name (" .$select_display_date .") (" .$count .")</option>";
$archive_select_links .= "<br><a href='index.php?x=browse&amp;archivedate=$thedate'>$name (" .$select_display_date .") (" .$count .")</a>";
}; // end while
$archive_select .= "</select>";
} // end else
// bulid the new tag
$tpl = str_replace("<BROWSE_MONTHLY_ARCHIVE_PAGED>",$archive_select,$tpl);
$tpl = str_replace("<BROWSE_MONTHLY_ARCHIVE_AS_LINK_PAGED>",$archive_select_links,$tpl);
//--------------- check if it should be the browse page
if($_GET['x'] == "browse") {
// initialize variables
$thumb_output = "";
$where = "";
$limit = "";
$pagenum = $_GET['pagenum'];
// did user select a category?
if($_GET['category'] != "") { $where = "and (t2.cat_id ='".$_GET['category']."')"; }
// do you use links with page number?
if ($_GET['pagenum'] != "") {
$start = $maxnumber_thumbs*($_GET['pagenum']-1);// calculate start and end of the thumbs in the selected page
$limit = " limit $start , $maxnumber_thumbs "; // create the limit command (in MS-SQL this should be TOP)
}// end if ($_GET['pagenum'] != "")
// build query
if ($_GET['archivedate']=="")
{
// no archive date
$query = "select t1.id,t1.headline,t1.image from {$pixelpost_db_prefix}pixelpost as t1
inner join {$pixelpost_db_prefix}catassoc as t2
where (t1.datetime<='$cdate')
$where
and t1.id = t2.image_id
group by t1.id
order by t1.datetime desc" .$limit;
} // if ($_GET['archivedate']=="")
else
{ // archive date is available
$archivedate_start = $_GET['archivedate'] ."-01 00:00:00";
$archivedate_end = $_GET['archivedate'] ."-31 23:59:59";
$query = "select id,headline,image from ".$pixelpost_db_prefix."pixelpost where (datetime<='$cdate' and datetime >='$archivedate_start' and datetime <= '$archivedate_end') $where order by datetime desc" .$limit;
}// end else if ($_GET['archivedate']=="")
echo $query;
$query = mysql_query($query);
//---------------------------- Making thumbs row
// for each record ...
while(list($id,$title,$name) = mysql_fetch_row($query)) {
echo $name;
// from the thumbnail row. This could be build by tables too.
$title = pullout($title);
$thumbnail = "thumbnails/thumb_$name";
$thumb_output .= "<a href='$PHP_SELF?showimage=$id'><img src='$thumbnail' alt='$title' title='$title' class='thumbnails' /></a>";
} //end while
// initialize page counter
$pagecounter=0;
//---------------- Get number of photos in database in the selected category
// initialize where command
$where = "";
// check if user selects a category
if($_GET['category'] != "") {
$queryr = "select count(*) as count,datetime
from {$pixelpost_db_prefix}catassoc as t1
inner join {$pixelpost_db_prefix}pixelpost t2 on t2.id = t1.image_id
where (t1.cat_id = '".$_GET['category']."' AND datetime<='$datetime')";
$queryr .= " group by t1.cat_id ";
}// end if
else // not cat selected return all images in the DB
{
$queryr = "select count(*) as count
from {$pixelpost_db_prefix}pixelpost
where ( datetime<='$datetime')";
} //end else
$monthname = "";
if($_GET['archivedate'] != "") {
$archivedate_start = $_GET['archivedate'] ."-01 00:00:00";
$archivedate_end = $_GET['archivedate'] ."-31 23:59:59";
$where = " and datetime >='$archivedate_start' and datetime <= '$archivedate_end' ";
$monthname = $_GET['monthname'];
$queryr = "select count(*) as count from ".$pixelpost_db_prefix."pixelpost where datetime<='$datetime'" .$where;
} // end if($_GET['archivedate'] != "")
$photonumb = mysql_query($queryr);
$row = mysql_fetch_array($photonumb);
// number of photos in the database in the same category
$pixelpost_photonumb = $row['count'];
// calculate the number of pages
$num_browse_pages = ceil($pixelpost_photonumb/$maxnumber_thumbs);
// initialize archive links
$Archive_pages_Links = "";
// selected category id
$cat_id = $_GET['category'];
//-------- Make page number to archive as links (for the selected category)
if ($_GET['category']!="")
{
$pagecounter = 0;
while ($pagecounter < $num_browse_pages)
{
$pagecounter++;
$Archive_pages_Links .= "<a href=?x=browse&amp;category=$cat_id&amp;pagenum=$p agecounter>$pagecounter</a> ";
}// end while
}// end if
else
{
if ($_GET['pagenum']!=""&$_GET['archivedate']=="")
{
$pagecounter = 0;
while ($pagecounter < $num_browse_pages)
{
$pagecounter++;
$Archive_pages_Links .= "<a href=?x=browse&amp;category=&amp;pagenum=$pagecoun ter>$pagecounter</a> ";
}// end while
}// end if
if ($_GET['archivedate']!="")
{
$pagecounter = 0;
while ($pagecounter < $num_browse_pages)
{
$monthname=str_replace(" ","%20",$monthname);
$pagecounter++;
$archivedate=$_GET['archivedate'];
$Archive_pages_Links .= "<a href=?x=browse&amp;archivedate=$archivedate&amp;mo nthname=$monthname&amp;pagenum=$pagecounter>$pagecounter</a> ";
}// whilte
}// end if $_GET['archivedate']!=""
}// end else
// selected category name
if($cat_id != "") {
$query = mysql_query("select name from ".$pixelpost_db_prefix."categories where id='$cat_id'");
$images_category_or_date = mysql_fetch_array($query);
$images_category_or_date = pullout($images_category_or_date['name']);
}
else
{
if ($_GET['archivedate']=="")
{$images_category_or_date = $lang_browse_all;}
else
{$images_category_or_date = $_GET['monthname'];}
}
} // end if ($_GET['x'] == "browse")
//------------- Make Archive browse menu with link to paged archive
// build browse menu
$browse_select = "";
// do you use links with page number?
if ($maxpthumb>0) {
$browse_select = "<select name='browse' onChange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>$lang_browse_select_category</option><option value='index.php?x=browse&amp;amp;category=&amp;pa genum=$pagenum'>$lang_browse_all (" .$pixelpost_all_photonumb .")</option>";}
else{
$browse_select = "<select name='browse' onChange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>$lang_browse_select_category</option><option value='index.php?x=browse&amp;amp;category='>$lang_browse_all (" .$pixelpost_all_photonumb .")</option>";}
$query = mysql_query("select * from ".$pixelpost_db_prefix."categories order by name");
while(list($id,$name) = mysql_fetch_row($query)) {
$name = pullout($name);
$queryr = "select count(*) as count,datetime
from {$pixelpost_db_prefix}catassoc as t1
inner join {$pixelpost_db_prefix}pixelpost t2 on t2.id = t1.image_id
where (t1.cat_id = '".$id."' AND datetime<='$datetime')
group by t1.cat_id ";
$count = mysql_query($queryr);
$count = mysql_fetch_array($count);
$count= $count['count'];
// check if you are using this addon
if ($maxpthumb>0) {
// u r using
$browse_select .= "<option value='index.php?x=browse&amp;amp;category=$id&amp ;pagenum=1'>$name (" .$count .")</option>";
} // end if pagenum!=""
else {
// use the original browse category menu
$browse_select .= "<option value='index.php?x=browse&amp;amp;category=$id'>$name (" .$count .")</option>";};
} // end while
// finilize the tag
$browse_select .= "</select>";
$tpl = str_replace("<BROWSE_CATEGORIES_PAGED>",$browse_select,$tpl); //Browse menu for paged archive
//----------------- Build the additional new tages
//-- If you use paged archive
if ($pagenum!=""){
$tpl = str_replace("<THUMBNAILS_WHOLE_PAGED>",$thumb_output,$tpl); //thumbnails in this page
$tpl = str_replace("<THUMBNAILS_PAGES_LINKS>",$Archive_pages_Links,$tpl); // link to the pages of thumbnail in the selected category
$tpl = str_replace("<ARCHIVE_PAGES_NUM>",$pagenum,$tpl);// page number you are viewing
$tpl = str_replace("<CATEGORY_OR_DATE_NAME_PAGED_ARCHIVE>",$images_category_or_date,$tpl); // Name of the category or Month you select
} //end if
//-- If you do not use page archive
else {
$tpl = str_replace("<THUMBNAILS_PAGES_LINKS>","",$tpl); // this does not use paged archive so there should be no links
$tpl = str_replace("<ARCHIVE_PAGES_NUM>","",$tpl); // page number you are viewing (it's empty for this case)
$tpl = str_replace("<THUMBNAILS_WHOLE_PAGED>",$thumb_output,$tpl); // the original thumb row in the archive
$tpl = str_replace("<CATEGORY_OR_DATE_NAME_PAGED_ARCHIVE>",$images_category_or_date,$tpl); // Name of the category or Month you select
}// end else
$tpl = str_replace("<LINK_TO_PAGED_ARCHIVE>",'<a href="index.php?x=browse&pagenum=1">Archive</a>',$tpl);
?>
raminia
04-12-2005, 09:09 AM
what's you php and mysql version.
raminia
04-12-2005, 09:13 AM
select t1.id,t1.headline,t1.image from pixelpost_testupgrade_pixelpost as t1 inner join pixelpost_testupgrade_catassoc as t2 where (t1.datetime<='2005-04-12 11:02:38') and (t2.cat_id ='2') and t1.id = t2.image_id group by t1.id order by t1.datetime desc limit 0 , 250
I meant
// from the thumbnail row. This could be build by tables too.
$title = pullout($title);
$thumbnail = "thumbnails/thumb_$name";
$thumb_output .= "<a href='$PHP_SELF?showimage=$id'><img src='$thumbnail' alt='$title' title='$title' class='thumbnails' /></a>";
} //end while
// initialize page counter
$pagecounter=0;
but the problem is somewhere inside database, MYSQL query returns no results and adding this would not help. checking some queries would help to find the problem.
raminia
04-12-2005, 09:52 AM
add this as
mydebug.php into the addon folder of yours.
<?php
if ($_GET['mydebug']=='yes')
{
$query = "select id,image from {$pixelpost_db_prefix}pixelpost";
$query = mysql_query($query);
while(list($id,$name) = mysql_fetch_row($query)) {
echo "Image id=" .$id ." - ImageName= " .$name ;
echo "<br />";
}
$query = "select id,cat_id,image_id from {$pixelpost_db_prefix}catassoc";
$query = mysql_query($query);
echo "<hr />";
while(list($id,$cat_id,$name) = mysql_fetch_row($query)) {
echo "catassocID= " .$id ." - Image id=" .$name ." - firstcatID= " .$cat_id;
echo "<br />";
}
exit;
}
?>
and open your photoblog with this link
http://doffer.net/index.php?mydebug=yes
and then report the results here. (copy paste everything)
UPDATE:
the above code is updated if you dload it before this note please update your code.
UPDATED AGAIN!! PLEASE USE THIS VERSION NOW!
doffer
04-12-2005, 01:52 PM
Done, and the results were:
Image id=23 - ImageName= evil-twin-frisor.jpg
Image id=12 - ImageName= glassfusion.jpg
Image id=13 - ImageName= bla-dis.jpg
(...)
catassocID= 1 - Image id=23 - firstcatID= 2
catassocID= 2 - Image id=12 - firstcatID= 5
catassocID= 3 - Image id=13 - firstcatID= 3
(...)
Since you are the one to know what this is supposed to return, I'll leave telleing if it's good or bad to you :wink:
doffer
04-12-2005, 01:54 PM
You asked about my php and mysql versions as well... This is some info:
PHP-version 4.3.9 ( Pixelpost's min requirement: PHP version 4.3.0 )
MySQL version 3.23.55-log ( Pixelpost's min requirement: MySQL 3.23.58 )
GD-lib bundled (2.0.28 compatible)
Server software Apache/1.3.29 (Unix) mod_perl/1.27 FrontPage/5.0.2.2623 PHP/4.3.9 PHP-CGI/0.1b
Should be ok, right?
EXIF Pixelpost is using exifer v1.5 for EXIF information.
What is exifer? Is it a script that reveals the exif info, even though it ain't on a exif compiled server?
Anonymous
04-12-2005, 02:37 PM
your MYSQL is not compatilble. upgrade to a newer version.
exifer works without any need on the server to be EXIF compliant.
doffer
04-12-2005, 02:45 PM
so that's the problem then... I guess I'll ask my host to upgrade, and if the won't do that, I'll have to stick to v. 1.3 :(
Anonymous
04-12-2005, 02:47 PM
The information you provided shows that category association is ok in the db-tables. I think the problem is with MYSQL that does not undrestand the provided statement.
change the line 246 to
if (!mysql_query($query)) echo "<br />MYSQL error: " .mysql_error();
that becom like this
}// end else if ($_GET['archivedate']=="")
if (!mysql_query($query)) echo "MYSQL error: " .mysql_error();
//---------------------------- Making thumbs row
and try to use the category archive. and tell me what it says.
Anonymous
04-12-2005, 02:50 PM
v1.3 also need similar mysql version.
try my last post and tell me the error.
doffer
04-12-2005, 02:57 PM
Everything is similar to the earlier atempts, except that the message on the top said:
MYSQL error: You have an error in your SQL syntax near 'where (t1.datetime<='2005-04-12 16:58:01') and (t2.cat_id ='5') and t1.i' at line 3
raminia
04-12-2005, 04:09 PM
I think the problem is with inner join statement that version 4.0.11 or higher would support !
I'm working on it.
doffer
04-12-2005, 04:18 PM
Your simply great raminia! :lol:
Don't know how this sort of script would have survived, unless everyone learned a bunch of programming languages, which I know would never happend. I know a bit, but obviously not enough to solve this kind of "mysteris"
raminia
04-12-2005, 04:24 PM
replace the code at about line 229 to 236 with this
// no archive date
$query = "select t1.id,t1.headline,t1.image from {$pixelpost_db_prefix}pixelpost as t1
inner join {$pixelpost_db_prefix}catassoc as t2
on t1.id = t2.image_id
where (t1.datetime<='$cdate')
$where
group by t1.id
order by t1.datetime desc" .$limit;
it will become like this
// build query
if ($_GET['archivedate']=="")
{
// no archive date
$query = "select t1.id,t1.headline,t1.image from {$pixelpost_db_prefix}pixelpost as t1
inner join {$pixelpost_db_prefix}catassoc as t2
on t1.id = t2.image_id
where (t1.datetime<='$cdate')
$where
group by t1.id
order by t1.datetime desc" .$limit;
} // if ($_GET['archivedate']=="")
else
{ // archive date is available
I might work!
doffer
04-12-2005, 04:34 PM
Sorry to say that there were no differnce :(
I've sent a mail to my hosting service and asked them to update. Is the exifer supposed to work right out of the box?
EDIT:
There were a difference... Now neither the categories nor the date link's working.
raminia
04-12-2005, 04:37 PM
exifer works out of the box.
it prompts no error any more? did you delete the line I provided that reports MYSQL Error? if not the problem is solved! I think you have a typo in using proper tag to show the thumbs in template now since it does not show the monthly archive any more. some hours a go it did!
If it doesn't work, try replacing with this code;
// no archive date
$query = "select t1.id,t1.headline,t1.image from {$pixelpost_db_prefix}pixelpost as t1,
{$pixelpost_db_prefix}catassoc as t2
WHERE t1.id = t2.image_id AND (t1.datetime<='$cdate')
$where
group by t1.id
order by t1.datetime desc" .$limit; This query should work the same, but does not use an inner join. Raminia mentioned that there was a problem with inner joins in your version of MySQL.
doffer
04-12-2005, 04:48 PM
Sorry, the debugging tag was NOT there, so I added them again and my current code arel:
}// end else if ($_GET['archivedate']=="")
echo $query;
$query = mysql_query($query);
//---------------------------- Making thumbs row
// for each record ...
while(list($id,$title,$name) = mysql_fetch_row($query)) {
echo $name;
doffer
04-12-2005, 04:56 PM
Thank you, thank you, thank you, thank you, both of you!
Commandos query worked out!
Now it works out as intended, and i'm really happy. Probably that query is better for the next release, considering the fact that not everybody (my self included) is not using the most actual version of mysql..
Anyway, thanks a lot to you raminia and to you commando for helping me!
BTW: Raminia, why are the banana prices so high in Teheran?
raminia
04-12-2005, 05:05 PM
Hurray commando you are greaT! :D
I'm glad that it worked. in this way we could maintain the downward compatibility but I think this is less efficient.
It's about a month that fruit prices are getting high and Bananas are mostly imported and that an additional factor for it to be more expensive.
:D
doffer
04-12-2005, 05:07 PM
I see.. Fruits are good anyway :) Hav a nice day :lol:
raminia
04-12-2005, 05:09 PM
DONT forget to delete the echo statements I provided.
It's 10 PM here;)
have nice day too.
doffer
04-12-2005, 05:11 PM
Thanks, I'll remove the echos, and thank you again for the help!
I'm glad it worked for you :D
We chose that version of mysql because it is very old and considered stable. The current release version of mysql is 4.1 and they have a beta version of 5.0 out. 3.23.55 was released in January of 2003. The required version was in Sept of 2003, so that is still fairly old ;)
Anyway, inner joins are more efficient, that is why we wrote them that way, but maybe we should replace them with the style I did above for compatibility as you said.
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.