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

0 Members and 1 Guest are viewing this topic.

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Add new array in details.html {hits2}= {image_hits)+1000
« on: November 08, 2007, 11:02:52 PM »
Hello guys,

I have a php question:

To add an new array (In details.html and details.php) you use:

In details.php:
$site_template->register_vars(array(
"test" => $lang['test'],
"test1" => $lang['test1'],
));
 
and then in details.html you use:
{test}

How can I add a new array {hits2}:
{hits2}= {image_hits)+1000 to use it in details.html.

I already add {lang_hits2} (NO PROBLEM), but the otherone I couldn't.

Thank you in advance,
Cruxy

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #1 on: November 08, 2007, 11:05:13 PM »
Wrong place cruxy. This topic is go to Request & Discussions.
@Nicky: Please move topic if possible.
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 #2 on: November 08, 2007, 11:17:00 PM »
I could not deleted it. So Nicky or other moderator will do it :)

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #3 on: November 08, 2007, 11:18:38 PM »
Is ok - is move now.

Quote
$site_template->register_vars(array(
"test" => $lang['test'],
"test1" => $lang['test1'],

If want 1000 more with image_hits ...

replace:

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

Use {hit2} in details.html file. ;)
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 thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #4 on: November 08, 2007, 11:21:21 PM »
I edit code ... small error. Is ok now. ;)
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 #5 on: November 08, 2007, 11:24:50 PM »
Great man! The second code works perfect. :D

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #6 on: November 09, 2007, 12:22:08 AM »
Thank for posting.
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 #7 on: November 10, 2007, 11:57:37 PM »
Hi, I tried to use {hit2} in the thumbnail_bit.html, but it does not work.  :cry:
How can I realize that?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #8 on: November 10, 2007, 11:59:29 PM »
Quote
Hi, I tried to use {hit2} in the thumbnail_bit.html, but it does not work.

Sigh - step 6 of my signature.  :roll:
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 #9 on: November 11, 2007, 12:22:54 AM »
Oke then,

I put {hits2} in the thumbnail_bit.html, but nothing was showing.
NOTE: The value of {hits2} is showing on the details.html  :|

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #10 on: November 11, 2007, 12:52:07 AM »
Ok so you want show this from index page too ?
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 #11 on: November 11, 2007, 12:54:40 AM »
I want to show it everywhre with thumbnail_bit.html. (home, categorie, datails)

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #12 on: November 11, 2007, 12:55:57 AM »
Ah ! - so now is clear.

In index.php and categories.php file,

find:

Quote
$site_template->register_vars("new_images", $new_images);

add before:

Code: [Select]
$new_images .= $site_template->register_vars("hit2", (isset($image_row['image_hits'])) ? $image_row['image_hits'] + 1000 : "");
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 thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Add new array in details.html {hits2}= {image_hits)+1000
« Reply #13 on: November 11, 2007, 12:57:57 AM »
I fix code ... small error .. is fix now. ;)
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 #14 on: November 11, 2007, 01:05:59 AM »
It's working! Thanks man :wink: