Author Topic: Static (Pre-Built) thumbnail_bit.html ?  (Read 7806 times)

0 Members and 1 Guest are viewing this topic.

Offline sumer

  • Newbie
  • *
  • Posts: 10
    • View Profile
Static (Pre-Built) thumbnail_bit.html ?
« on: January 12, 2007, 09:08:48 AM »
Hi, i have been cloning the "Show New Images" code in index.php to create other top 10 stuff such as most viewed, and most commented, etc... infact my question on this post can be considered that it is related to "Show New Images" section only. (to minimize confusion ) 

however i would like to be able to have total control over the top 10 , i dont want index.php to decide how my table and rows will look like, i want to use a static thumbnail_bit.html

WHY?: Because i want to insert image for the #1 item but no images for the rest. & i want to have more control over it when i design it's HTML.

here's a sample of what i want to do to thumbnail_bit.html

  ( consider this table being the html code of thumbnail_bit.html )


basicly i get to control exactly how the top 10 will look like, by editing thumbnail_bit.html  and decide if i want certain stuff on the #1 spot and if i want to remove certain information from the #2 spot, etc..

i know this will have an interference with "search.php and other sections however i plan on using a different cloned  thumbnail_bit.html for them.



« Last Edit: January 12, 2007, 10:27:11 AM by sumer »

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Static (Pre-Built) thumbnail_bit.html ?
« Reply #1 on: January 12, 2007, 10:23:51 AM »
1. you can use this ... http://www.4homepages.de/forum/index.php?topic=15599.0 ...
2. rebuild the table code (html- in php-code) of "top_images" ( a copy of your "new_images" ) to your needs (vertical ... ) ...
3. use in "top_images" instead of "thumbnail_bit.html" a new "thumbnail_top_bit.html" ...
4. here a example for your new "thumbnail_top_bit.html" without thumbnail as a edited copy of "thumbnail_bit.html" ...
Code: [Select]
ID: {image_id} - Cat-ID: {cat_id} - Title: {image_name} - {image_description} - Rating: {image_rating} Hits: {image_hits}
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline sumer

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Static (Pre-Built) thumbnail_bit.html ?
« Reply #2 on: January 12, 2007, 10:36:26 AM »
I have seen that an it's perfect, however i need to have total control over my  thumbnails_bit.html so that i can decide what color to use as bg color for which row, and if i want to insert a thumbnail on #1 and not on #2,.. etc.. many design related modifications would be much easier to do directly on thumbnail_bit.html rather than with index.php :cry:

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Static (Pre-Built) thumbnail_bit.html ?
« Reply #3 on: January 12, 2007, 11:14:47 AM »
... many design related modifications would be much easier to do directly on thumbnail_bit.html rather than with index.php ...

... in both design related modifications are in html ... !
... if you want different "thumbnail_top_bit.html" ... than ok ...
... insert a counter as "$count" in your "top_images" and start with ...
Code: [Select]
$count = 1;
... and use instead this ...
Code: [Select]
$top_images .= $site_template->parse_template("thumbnail_top_bit");
... this ...
Code: [Select]
if ($count == 1)  {
$top_images .= $site_template->parse_template("thumbnail_top_1_bit");
} elseif ($count == 2)  {
$top_images .= $site_template->parse_template("thumbnail_top_2_bit");
} elseif ($count == 3)  {
$top_images .= $site_template->parse_template("thumbnail_top_3_bit");
} else  {
$top_images .= $site_template->parse_template("thumbnail_top_bit");
}

... now you can design your different "thumbnail_top_bit.html" to your needs ...
... with thumbnail, without thumbnail, with table, without table, bgcolor="green", bgcolor="red", bgcolor="blue" etc. ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline sumer

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Static (Pre-Built) thumbnail_bit.html ?
« Reply #4 on: January 12, 2007, 11:25:21 AM »
sounds good but wouldnt this mean i would have to parse like 10 different thumbnail_bit.html templates?
this actually could work for me, however would there be to much server load if i have 5 different top 10 lists
on my home.html page  :D

which means i might need as many parsings as 50
would that slow down the server load or web page load?


also i prefer not connecting pieces but rather have just 1 piece of  thumbnail_bit_top.html

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Static (Pre-Built) thumbnail_bit.html ?
« Reply #5 on: January 12, 2007, 11:47:47 AM »
sounds good but wouldnt this mean i would have to parse like 10 different thumbnail_bit.html templates?

... if you like 10 different thumbnail_top_bit ... than 10 ...
... if you like it like your preview image ... than only 4 ...

... however would there be to much server load if i have 5 different top 10 lists ...

... :roll: ...
... there are only 4 different "thumbnail_top_bit.html" in 1 top 10 list ...
... and if you want more top 10 lists ... than use always the same 4 different "thumbnail_top_bit.html" ...
... and there is no much server load ...
... but if you want ... you can also put all the "tumbnail_top_bit" html-code in "top_images" php-code ...
... than you don't need any parse templates ...

... here you can see 3 different "thumbnail_bit" (and much more) in action ...  :wink:
« Last Edit: January 12, 2007, 12:03:13 PM by mawenzi »
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline sumer

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Static (Pre-Built) thumbnail_bit.html ?
« Reply #6 on: January 12, 2007, 12:32:23 PM »
excellent, so if i want to use html instead of templates i can use this code below correct?

and i can use stuff like {image_id} and {image_name} inside the HTML ?

Code: [Select]
$top_images .= "TABLE BEGINS";
if ($count == 1)  {
$top_images .= "HTML FOR #1 GOES HERE";
} elseif ($count == 2)  {
$top_images .= "HTML FOR #2 GOES HERE";
} elseif ($count == 3)  {
$top_images .= "HTML FOR #3 GOES HERE";
} else  {
$top_images .= "HTML FOR THE REST (4 TO 10) GOES HERE";
}
$top_images .= "TABLE ENDS";


this actually gets my attention the most. the less things i have to modify when i re-design the better. :)

thanks for the awesome support, and help  8) :) :D :wink:
« Last Edit: January 12, 2007, 01:00:08 PM by sumer »

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Static (Pre-Built) thumbnail_bit.html ?
« Reply #7 on: January 12, 2007, 01:56:32 PM »
excellent, so if i want to use html instead of templates i can use this code below correct?

... yes ...  :wink:

and i can use stuff like {image_id} and {image_name} inside the HTML ?

... no ...
... only in "thumbnail_bit.html" you can use this stuff ...  :wink:
... and that is the advantage of "thumbnail_bit.html" ...  :!: 
... but you can use this ... e.g. ...
Code: [Select]
$top_images .= "HTML FOR #1 GOES HERE ".$image_row['image_name']." HTML FOR #1 GOES HERE ".$image_row['image_rating']."HTML FOR #1 GOES HERE ";
... it is a mix of php- and html-code and you may not have any mistake in that mix ...  :!:
... in your case I would use different "thumbnail_bit.html"s ... the sum of the code (in php and html) is then more shortly ... :!:
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline sumer

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Static (Pre-Built) thumbnail_bit.html ?
« Reply #8 on: January 12, 2007, 05:26:10 PM »
my itention is try to use just 1 HTML template for the entire top 10 list.
i am happy with using php codes inside the HTML template

$image_row['image_name']  instead of {image_name} inside this HTML file
and to make the PHP code shorter.

is it possible to use these inside home.html itself? ( without using thumbnail_bit.html )

or perhaps 
1: $image_row(0)['most_veiewed_image_name'] - $image_row(0)['most_veiewed_cat_id']
2: $image_row(1)['most_veiewed_image_name'] - $image_row(1)['most_veiewed_cat_id']
3: $image_row(2)['most_veiewed_image_name'] - $image_row(2)['most_veiewed_cat_id']
4: $image_row(3)['most_veiewed_image_name'] - $image_row(3)['most_veiewed_cat_id']

etc...

directly inside the home.html



Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Static (Pre-Built) thumbnail_bit.html ?
« Reply #9 on: January 12, 2007, 05:51:50 PM »
is it possible to use these inside home.html itself? ( without using thumbnail_bit.html )

1. ... this is php-code ... that you can't use in that way in home.html ... a html-file ...
2. ... if you would like to use php-code in a html-file ... than only in this way ...
Code: [Select]
<... html-code ...>
<?php
$php_code 
$php_code;
?>

<... html-code ...>
3. ... but you must use in your php-code also sql-querys etc. if it should work ...
4. ... and thats why it is better you put the php-code in index.php and use the tags (e.g. {image_name}) in home.html and thumbnail_bit.html ...
5. ... the best way in your case to realised your "Top_Images" is by using different "thumbnail_bit.html"s ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...