Author Topic: Add new array in details.html {hits2}= {image_hits)+1000  (Read 23249 times)

0 Members and 1 Guest are viewing this topic.

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #30 on: November 14, 2007, 01:38:07 AM »
Nope, the same result. it does not show!

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #31 on: November 14, 2007, 01:44:19 AM »
Post edit. Next time, please say all detail. You no say for use $hits2 in code.
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 ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #32 on: November 14, 2007, 02:00:17 AM »
Quote
Next time, please say all detail. You no say for use $hits2 in code
I was talking the hole time about $hits2 and that was my request. It does not matter.

Nothing is showing yet. Here is my new code, maybe you can see what we miss here:

Code: [Select]
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_date, i.image_active, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.image_honor = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")
        ORDER BY i.image_date DESC
        LIMIT 20";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
if (!$num_rows)  {
   $featured_images_list = $lang['no_images'];
}
 
else  {
   //$featured_images_list = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\"><tr><td>Image Name</td><td>Current Hits</td><td>Hits +1000</td></tr>";
 //$featured_images_list .= "<tr><td><a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$image_row['image_id'])."\">".format_text(trim($image_row['image_name']), 2)."</a></td><td>".$image_row['image_hits']."</td><td>$hits2</td></tr>";
   
   $new_images .= $site_template->register_vars("hits2", (isset($image_row['image_hits'])) ? $image_row['image_hits'] + 1000 : "");
   while ($image_row = $site_db->fetch_array($result)){
   
   $hits2 = $site_template->register_vars("hits2", (isset($image_row['image_hits'])) ? $image_row['image_hits'] + 1000 : "");
   $featured_images_list .= "<tr><td><a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$image_row['image_id'])."\">".$image_row['image_name']."</a></td><td>".$image_row['image_hits']."</td><td>" .$hits2. "</td></tr>";
}                                  
}
  $featured_images .= "</table>\n";

$site_template->register_vars("featured_images_list", $featured_images_list);
unset($featured_images_list);

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #33 on: November 14, 2007, 02:01:11 AM »
In your code you used hit2, it should be actualy shits2.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #34 on: November 14, 2007, 02:09:42 AM »
Ok I miss post:

http://www.4homepages.de/forum/index.php?topic=19358.msg104767#msg104767

so:

Quote
$hits2 = $site_template->register_vars("hits2", (isset($image_row['image_hits'])) ? $image_row['image_hits'] + 1000 : "");
   $featured_images_list .= "<tr><td><a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$image_row['image_id'])."\">".format_text(trim($image_row['image_name']), 2)."</a></td><td>".$image_row['image_hits']."</td><td>" .$hits2. "</td></tr>";

good ?
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 ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #35 on: November 14, 2007, 02:15:15 AM »
No! Very strange!

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #36 on: November 14, 2007, 02:22:25 AM »
Ok, change:

Code: [Select]
$hits2 = $site_template->register_vars("hits2", (isset($image_row['image_hits'])) ? $image_row['image_hits'] + 1000 : "");

for:

Code: [Select]
$hits2 = (isset($image_row['image_hits'])) ? $image_row['image_hits'] + 1000 : "";
« Last Edit: November 14, 2007, 12:05:02 PM by kai »
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 ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #37 on: November 14, 2007, 02:28:19 AM »
Finaly. Thank you Thunderstrike.
Now I can go to bed. Good night!
(Nothing is impossible!) :wink: