Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > SUPPORT / INFORMATION > Pixelpost Help

Post Reply
 
Thread Tools
  #11  
Old 01-24-2007, 09:08 PM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
Ahh, yes. I forgot. I modified the original addon to fix this.

Try this and let me know if it works.

!!!Please make a backup of admin_PostSlug.php before you continue!!!

Open admin_PostSlug.php, find the following lines and make the changes:

Find on line 631:
PHP Code:
$image_previous_link_slug "<a href='$slugprefix$image_previous_slug'>$lang_previous</a>"
Replace with:
PHP Code:
$image_previous_link_slug "<a href='/$image_previous_slug'>$lang_previous_slug</a>"// Modified by Dwilkinsjr 
- and -

Find on line 649:
PHP Code:
$image_next_link_slug "<a href='$slugprefix$image_next_slug'>$lang_next</a>"
Replace with:
PHP Code:
$image_next_link_slug "<a href='/$image_next_slug'>$lang_next_slug</a>"// Modified by Dwilkinsjr 
Reply With Quote
  #12  
Old 01-24-2007, 10:09 PM
jaywilliams's Avatar
jaywilliams+ Offline
Team Pixelpost
 
Join Date: Sep 2005
Posts: 1,003
Send a message via AIM to jaywilliams Send a message via MSN to jaywilliams Send a message via Yahoo to jaywilliams Send a message via Skype™ to jaywilliams
Ask and you shall recieve!

I've had quite a few requests for help with integrating mod_rewrite with the PostSlug Addon.

So now, due to popular request, I now have a new version designed exclusively for use with mod_rewrite.

Just download it, and follow the short list of instructions found in the readme file, and you should be good to go.

PostSlug_1.0.1_beta_modrewrite.zip

Enjoy!

P.S. This version also modifies the RSS & ATOM feed so they use Post Slug too!
__________________
Jay Williams | A Different View
Reply With Quote
  #13  
Old 01-24-2007, 10:35 PM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
Good work Jay. This will make it easier on all of us
Reply With Quote
  #14  
Old 01-26-2007, 02:00 PM
boffers Offline
forum loafer
 
Join Date: Aug 2006
Posts: 18
Thank you so much all!
I only have one more thing I need to change and I do not know who can help me here: a Photosug expert or a Geos_Show_Category expert. I am using the <SC_THUMB_ROW> because I am using this for: http://bas.offersphoto.com - It only needs to show thumbnails on the first page only of one specific category. The links are still working with ID's: I would like to change this in a photoslug link. Can anyone help with this?
The last thing I need to do is changig the Google Map links to the photos: they are using ID's as well.

Furthermore I am still interested in the discussion I actually wanted to start ;-)
Reply With Quote
  #15  
Old 01-26-2007, 02:08 PM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
I have never used Geos's show cat addon but i'll have a look. it should be real simple. I'll report my findings soon. No promises though
Reply With Quote
  #16  
Old 01-26-2007, 02:21 PM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
Ok, please make a backup before you do anything! This has not been tested!!! I'm hoping it works

find the following on line 454:
PHP Code:
/***********************************************************************************
*
*                      thumbnails row for image_template
*
***********************************************************************************/ 
Replace everything bellow with this:
PHP Code:
if($sc_th_row == 1)
{
    
$category 0;
    
$aheadlimit round(($cfgrow['thumbnumber']-1)/2);
    
$behindlimit round(($cfgrow['thumbnumber']-1)/2);

    if(
$cfgrow['thumbnumber']%2==0)    $cfgrow['thumbnumber']++;

    if(isset(
$_GET["category"]) && is_numeric($_GET["category"]))
    {
        
$sql9 "SELECT COUNT(p.id) AS count FROM ".$pixelpost_db_prefix."pixelpost AS p, ".$pixelpost_db_prefix."catassoc AS c WHERE (p.datetime > '$image_datetime') AND (p.datetime<='$cdate') AND (p.id = c.image_id) AND (c.cat_id = ".$_GET["category"].")";
        
$sql10 "SELECT COUNT(p.id) AS count FROM ".$pixelpost_db_prefix."pixelpost AS p, ".$pixelpost_db_prefix."catassoc AS c WHERE (p.datetime < '$image_datetime') AND (p.datetime<='$cdate') AND (p.datetime<='$cdate') AND (p.id = c.image_id) AND (c.cat_id = ".$_GET["category"].")";
        
$category 1;
        
$cat_ow '&amp;category='.$_GET["category"];
    }
    else
    {
        
$sql9 "SELECT COUNT(id) AS count FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime > '$image_datetime') AND (datetime<='$cdate')";
        
$sql10 "SELECT COUNT(id) AS count FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime < '$image_datetime') AND (datetime<='$cdate')";
        
$cat_ow '';
    }

    
$aheadnumb sql_array($sql9);
    
$behindnumb sql_array($sql10);

    
$aheadnumb $aheadnumb['count'];
    
$behindnumb $behindnumb['count'];

    if(
$aheadnumb <= $aheadlimit)
    {
        
$behindlimit = ($cfgrow['thumbnumber']-1)-$aheadnumb;
        
$aheadlimit $aheadnumb;
    }

    if(
$behindnumb <= $behindlimit)
    {
        
$aheadlimit = ($cfgrow['thumbnumber']-1)-$behindnumb;
        
$behindlimit $behindnumb;
    }

    
$ahead_thumbs "";
    
$ahead_thumbs_reverse "";
    
$behind_thumbs "";
    
$behind_thumbs_reverse ="";

    if(
$category == 0)
    {
        
$sql11 "SELECT id,headline,image,slug FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime > '$image_datetime') AND (datetime<='$cdate') ORDER BY datetime asc limit 0,$aheadlimit";
    }
    else
    {
        
$sql11 "SELECT p.id,p.headline,p.image,p.slug FROM ".$pixelpost_db_prefix."pixelpost AS p, ".$pixelpost_db_prefix."catassoc AS c WHERE (p.datetime > '$image_datetime') AND (p.datetime<='$cdate') AND (p.id = c.image_id) AND (c.cat_id = ".$_GET["category"].") ORDER BY p.datetime asc limit 0,$aheadlimit";
    }
    
$thumbs_ahead mysql_query($sql11);

    while(list(
$id,$headline,$image,$slug) = mysql_fetch_row($thumbs_ahead))
    {
        
$headline pullout($headline);
        
$headline htmlspecialchars($headline,ENT_QUOTES);
        list(
$local_width,$local_height) = getimagesize("thumbnails/thumb_$image_name");
        
$ahead_thumbs .= "<a href='$slug$cat_ow' class='gsc_thumb_row'><img src='thumbnails/thumb_$image' alt='$headline' title='$headline' class='thumbnails' width='$local_width' height='$local_height' /></a>";
        
$ahead_thumbs_reverse "<a href='$slug$cat_ow' class='gsc_thumb_row'><img src='thumbnails/thumb_$image' alt='$headline' title='$headline' class='thumbnails' width='$local_width' height='$local_height' /></a>" .$ahead_thumbs_reverse ;
    }

    if(
$category == 0)
    {
        
$sql12 "SELECT id,headline,image,slug FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime < '$image_datetime') AND (datetime<='$cdate') ORDER BY datetime desc limit 0,$behindlimit";
    }
    else
    {
        
$sql12 "SELECT p.id,p.headline,p.image,p.slug FROM ".$pixelpost_db_prefix."pixelpost AS p, ".$pixelpost_db_prefix."catassoc AS c WHERE (p.datetime < '$image_datetime') AND (p.datetime<='$cdate') AND (p.id = c.image_id) AND (c.cat_id = ".$_GET["category"].") ORDER BY p.datetime desc limit 0,$behindlimit";
    }
    
$thumbs_behind mysql_query($sql12);

    while(list(
$id,$headline,$image,$slug) = mysql_fetch_row($thumbs_behind))
    {
        
$headline pullout($headline);
        
$headline htmlspecialchars($headline,ENT_QUOTES);
        list(
$local_width,$local_height) = getimagesize("thumbnails/thumb_$image_name");
        
$behind_thumbs "<a href='$slug$cat_ow' class='gsc_thumb_row'><img src='thumbnails/thumb_$image' alt='$headline' title='$headline' class='thumbnails' width='$local_width' height='$local_height' /></a>$behind_thumbs";
        
$behind_thumbs_reverse .= "<a href='$slug$cat_ow' class='gsc_thumb_row'><img src='thumbnails/thumb_$image' alt='$headline' title='$headline' class='thumbnails' width='$local_width' height='$local_height' /></a>";
    }

    list(
$local_width,$local_height) = getimagesize("thumbnails/thumb_$image_name");
    
$sc_thumb_row "$behind_thumbs<a href='$slug$cat_ow' class='gsc_thumb_row'><img src='thumbnails/thumb_$image_name' alt='$image_title' title='$image_title' class='current-thumbnail' width='$local_width' height='$local_height' /></a>$ahead_thumbs";
    
$sc_thumb_row_rev "$ahead_thumbs_reverse<a href='$slug$cat_ow' class='gsc_thumb_row'><img src='thumbnails/thumb_$image_name' alt='$image_title' title='$image_title' class='current-thumbnail' width='$local_width' height='$local_height' /></a>$behind_thumbs_reverse";

Do not delete / modify / or replace the following!!!
PHP Code:
$tpl str_replace("<SC_IMAGE_PREVIOUS_ID>",$sc_previous_id,$tpl);
$tpl str_replace("<SC_IMAGE_PREVIOUS_NAME>",$sc_previous_name,$tpl);
$tpl str_replace("<SC_IMAGE_PREVIOUS_TITLE>",$sc_previous_title,$tpl);
$tpl str_replace("<SC_IMAGE_PREVIOUS_DATETIME>",$sc_previous_datetime,$tpl);
$tpl str_replace("<SC_IMAGE_PREVIOUS_DATETIME_FORM>",$sc_previous_datetime_form,$tpl);
$tpl str_replace("<SC_IMAGE_PREVIOUS_LINK>",$sc_previous_link,$tpl);
$tpl str_replace("<SC_IMAGE_PREVIOUS_LINK_TXT>",$sc_previous_link_txt,$tpl);
$tpl str_replace("<SC_IMAGE_NEXT_ID>",$sc_next_id,$tpl);
$tpl str_replace("<SC_IMAGE_NEXT_NAME>",$sc_next_name,$tpl);
$tpl str_replace("<SC_IMAGE_NEXT_TITLE>",$sc_next_title,$tpl);
$tpl str_replace("<SC_IMAGE_NEXT_DATETIME>",$sc_next_datetime,$tpl);
$tpl str_replace("<SC_IMAGE_NEXT_DATETIME_FORM>",$sc_next_datetime_form,$tpl);    
$tpl str_replace("<SC_IMAGE_NEXT_LINK>",$sc_next_link,$tpl);
$tpl str_replace("<SC_IMAGE_NEXT_LINK_TXT>",$sc_next_link_txt,$tpl);
$tpl str_replace("<SC_CAT_ID>",$sc_cat_id,$tpl);
$tpl str_replace("<SC_CAT_NAME>",$sc_category,$tpl);
$tpl str_replace("<SC_BROWSE_CATEGORY>",$sc_browse_category,$tpl);
$tpl str_replace("<SC_THUMBNAILS>",$sc_thumb_output,$tpl);
$tpl str_replace("<SC_THUMBNAILS_NAV>",$sc_thumb_nav,$tpl);
$tpl str_replace("<SC_THUMB_ROW>",$sc_thumb_row,$tpl);
$tpl str_replace("<SC_THUMB_ROW_REV>",$sc_thumb_row_rev,$tpl);

?> 
Reply With Quote
  #17  
Old 01-26-2007, 07:53 PM
boffers Offline
forum loafer
 
Join Date: Aug 2006
Posts: 18
Thanks a lot: it is working now! The only thing I changed: I took $cat_ow out of the links. I got an error. For me it is most important the first page of the category works good, it doesn't matter that when you do click on something and go to an other photo, thumbnails are shown that are not from this category. So now it works as I hoped! Thanks a lot!
Reply With Quote
  #18  
Old 01-26-2007, 09:27 PM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
Thats great to hear! Enjoy.
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 01:56 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs