Author Topic: Help to modify code for show visited categories  (Read 3462 times)

0 Members and 1 Guest are viewing this topic.

Offline amdeus

  • Pre-Newbie
  • Posts: 1
    • View Profile
Help to modify code for show visited categories
« on: July 01, 2005, 03:43:48 AM »
I am  Brazilian guy and of an aid.

How to modify script below to show the visited categories more?

they forgive for the bad English



Code: [Select]
<?php
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('SCRIPT_URL''http://mygallery');
define('ROOT_PATH''./');

include(
ROOT_PATH.'config.php');
include(
ROOT_PATH.'includes/db_mysql.php');
include(
ROOT_PATH.'includes/constants.php');
$site_db = new Db($db_host$db_user$db_password$db_name);
function 
is_remote($file_name) {
  return (
preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i'$file_name)) ? 0;
}
echo
'<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100">
<tr>'
;
$sql "SELECT a.image_id, a.cat_id, a.image_active, a.image_thumb_file, a.image_name, a.image_hits
        FROM "
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
        WHERE a.image_active=1
        AND a.cat_id = b.cat_id
        AND b.auth_viewcat="
.AUTH_ALL."
        AND b.auth_viewimage="
.AUTH_ALL."
        ORDER BY image_hits DESC
        LIMIT 3"
;
$result $site_db->query($sql);
while (
$row $site_db->fetch_array($result)) {
$image_name $row['image_name'];
$image_hits $row['image_hits'];
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo 
"<td align=\"center\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"135\">
<tr>
<td bgcolor=\"#E1E1E1\" align=\"center\" height=\"10\">
<p align=\"left\"><b>
$image_name</b></p>
</td>
</tr>
<tr>
<td bgcolor=\"#EFEFEF\" align=\"center\" height=\"75\" background=\"./arquivo/templates/default/images/img_fundo_thumb.gif\">
<p><a href=\""
.SCRIPT_URL."details.php?image_id=$image_id\" target=_parent><img src=\"".$thumb_src."\" border=\"0\" vspace=\"3\" hspace=\"3\"></a></p>
</td>
</tr>
<tr>
<td bgcolor=\"#EFEFEF\" align=\"left\" height=\"10\" width=\"125\">
<p>Visualizações: 
$image_hits</p>
</td>
</tr>
</table>
</td>"
;}
echo 
'</tr>
</table>'
;
?>


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Help to modify code for show visited categories
« Reply #1 on: July 01, 2005, 05:39:43 AM »
4images does not track which category/image u've visited.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Help to modify code for show visited categories
« Reply #2 on: September 09, 2007, 08:41:52 PM »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?