https://www.icyphoenix.com/viewtopic.php?f=26&t=2532
-----------------------------------
Goldberg
Fri 27 Jul, 2007 16:39

FAP SUPPORT - Smartor Album Version Raised To 2.0.56a Included In FAB?
-----------------------------------
I saw on http://smartor.is-root.com/ that Smartor Album version raised to 2.0.56a. I'm using FAB 1.4.1 on my testsite and was wondering if the fix is included or has to be included in FAB 1.4.1

[url=http://smartor.is-root.com/viewtopic.php?p=73886#73886]Link

[code linenumbers=false]
#
#-----[ OPEN ]------------------------------------------
#
album_page.php

#
#-----[ FIND ]------------------------------------------
#
/*
+----------------------------------------------------------
| Main work here...
+----------------------------------------------------------
*/

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Next
$sql = "SELECT new.pic_id, new.pic_time
      FROM ". ALBUM_TABLE ." AS new, ". ALBUM_TABLE ." AS cur
      WHERE cur.pic_id = $pic_id
         AND new.pic_id <> cur.pic_id
         AND new.pic_cat_id = cur.pic_cat_id
         AND new.pic_time >= cur.pic_time";

$sql .= ($thispic['pic_cat_id'] == PERSONAL_GALLERY) ? " AND new.pic_user_id = cur.pic_user_id" : "";
$sql .= " ORDER BY pic_time ASC LIMIT 1";

if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}

$row = $db->sql_fetchrow($result);

if( empty($row) )
{
   $u_next = "";
   $l_next = "";
}
else
{
   $new_pic_id = $row['pic_id'];
   $u_next = append_sid("album_page.$phpEx?pic_id=$new_pic_id");
   $l_next = $lang['Next'] . "&nbsp;&raquo;";
}

// Prev
$sql = "SELECT new.pic_id, new.pic_time
      FROM ". ALBUM_TABLE ." AS new, ". ALBUM_TABLE ." AS cur
      WHERE cur.pic_id = $pic_id
         AND new.pic_id <> cur.pic_id
         AND new.pic_cat_id = cur.pic_cat_id
         AND new.pic_time <= cur.pic_time";

$sql .= ($thispic['pic_cat_id'] == PERSONAL_GALLERY) ? " AND new.pic_user_id = cur.pic_user_id" : "";
$sql .= " ORDER BY pic_time DESC LIMIT 1";

if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql);
}

$row = $db->sql_fetchrow($result);

if( empty($row) )
{
   $u_prev = "";
   $l_prev = "";
}
else
{
   $new_pic_id = $row['pic_id'];
   $u_prev = append_sid("album_page.$phpEx?pic_id=$new_pic_id");
   $l_prev = "&laquo;&nbsp;" . $lang['Previous'];
}
// end

#
#-----[ FIND ]------------------------------------------
#
   'U_NEXT' => append_sid("album_page.$phpEx?pic_id=$pic_id&amp;mode=next"),
   'U_PREVIOUS' => append_sid("album_page.$phpEx?pic_id=$pic_id&amp;mode=previous"),

   'L_NEXT' => $lang['Next'],
   'L_PREVIOUS' => $lang['Previous'],

#
#-----[ REPLACE WITH ]------------------------------------------
#
   'U_NEXT' => $u_next,
   'U_PREVIOUS' => $u_prev,

   'L_NEXT' => $l_next,
   'L_PREVIOUS' => $l_prev,

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/album_page_body.tpl

#
#-----[ FIND ]------------------------------------------
#
         <span class="cattitle">&laquo;&nbsp;<a href="{U_PREVIOUS}" class="cattitle">{L_PREVIOUS}</a>&nbsp;-&nbsp;<a href="{U_NEXT}" class="cattitle">{L_NEXT}</a>&nbsp;&raquo;</span>

#
#-----[ REPLACE WITH ]------------------------------------------
#
         <span class="cattitle"><a href="{U_PREVIOUS}" class="cattitle">{L_PREVIOUS}</a>&nbsp;-&nbsp;<a href="{U_NEXT}" class="cattitle">{L_NEXT}</a></span>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#

# EoM [/code]


-----------------------------------
Artie
Fri 27 Jul, 2007 16:57

Re: Smartor Album Version Raised To 2.0.56a Included In FAB?
-----------------------------------
No fix needed.
That problem should not exist in FAP 1.4.1


-----------------------------------
Goldberg
Fri 27 Jul, 2007 17:10

Re: Smartor Album Version Raised To 2.0.56a Included In FAB?
-----------------------------------
That's great, thanks for the quick reply.


-----------------------------------
Artie
Fri 27 Jul, 2007 17:24

Re: Smartor Album Version Raised To 2.0.56a Included In FAB?
-----------------------------------
You're welcome.....you caught me in good mood  :wink:


