4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: BartAfterDark on December 23, 2006, 01:26:30 AM
-
Hi,
Is there anyway to show more random images on any page of the site?
- Lars
-
Hi,
look here:
http://www.4homepages.de/forum/index.php?topic=4259.15 (http://www.4homepages.de/forum/index.php?topic=4259.15)
Search function from this forum is also a good way to find a answer :wink:
cu
Kurt
-
Wie bewerktstelligt man das?
Ich möchte mehrere Random Images anzeigen lassen und zwar so :D
{if random_image}
<div id="left_outer">
<div class="left_inner_float">
<div class="left_inner">
<div class="module_menu">
<div>
<div>
<div>
<h3>Zufalls Cover</h3>
<ul class="menu">
{random_image}
{random_image}
{random_image}
{random_image}
{random_image}
{random_image}
{random_image}
{random_image}
{random_image}
{random_image}
{random_image}
{random_image}
{random_image}
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{endif random_image}
Aber es wird immer das gleiche ausgegeben, wie funktioniert das? Das jedes zufällig ausgegeben wird?
-
...
und zwar so
ich verstehe jetzt nicht warum du das unbedingt so haben möchtest, viel freude wirst du damit nicht haben:
in der page_header.php suche:
$z<=5 gibt die anzahl der bilder an.
$random_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image();
$site_template->register_vars("random_image", $random_image);
unset($random_image);
ersetzte es mit :
for ($z=0; $z<=5; $z++){
$random_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image();
$site_template->register_vars("random_image$z", $random_image);
unset($random_image);
}
in der home.html kannst du jetzt {random_image1} {random_image2} {random_image..N} schreiben.
-
Rembrandt,
For me.. it returned the same image for 5 times..
Thanks,
batu544
-
@batu544, forgot the code, the code is shi*t.
For me I would do it differently,pretending are nonsense.
-
Mein Spaß werde ich damit haben, allerdings funktioniert das aber nicht.
Der Code;
{if random_image}
<!-- Start Left Module -->
<div id="left_outer">
<div class="left_inner_float">
<div class="left_inner">
<div class="module_menu">
<div>
<div>
<div>
<h3>Zufalls Cover</h3>
<ul class="menu">
{random_image1}
{random_image2}
{random_image3}
{random_image4}
{random_image5}
{random_image6}
{random_image7}
{random_image8}
{random_image9}
{random_image10}
{random_image11}
{random_image12}
{random_image13}
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Ende Left Module -->
{endif random_image}
for ($z=0; $z<=13; $z++){
$random_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image();
$site_template->register_vars("random_image$z", $random_image);
unset($random_image);
}
Es werden immernoch NUR diie gleichen anbgezeigt und nicht unterschiedlich, siehe Anhang
-
so..
suche in der page_header.php:
unset($category_dropdown_form);
füge darunter ein:
//######################################### Random Images Start #########################################################
$num_random_images = $config['image_cells'];
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, 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 c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
ORDER BY RAND()
LIMIT $num_random_images ";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
if (!$num_rows) {
$random_images = $lang['no_random_images'];
}
else {
$random_images ="";
while ($image_row = $site_db->fetch_array($result)){
show_image($image_row);
$random_images .= $site_template->parse_template("random_bit");
} // end while
} // end else
$site_template->register_vars(array(
"random_images" => $random_images
));
unset($random_images);
//######################################### Random Images END #########################################################
erstell eine neue datei mit den namen "random_bit.html" und speichere sie in deinen template ordner:
{thumbnail}
<br>
<b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new} ({user_name_link})
<br>
<a href="{cat_url}">{cat_name}</a><br />
{if allow_comments}{lang_comments} {image_comments}{endif allow_comments}<br />
{lightbox_button}
suche in deinTemplates/home.html :
{random_image}
und ersetze es mit:
{random_images}
mfg Andi
-
Den ersten Code den du gepostet hast aber auch wieder rein oder?
-
nein, vergiss den.
die bildanzahl ist so von den wert abhängig der im ACP festgelegt ist, möchtest du anzahl der bilder ändern, ersetze (im code ganz oben):
$num_random_images = $config['image_cells'];
z.b. für 10 bilder:
$num_random_images = 10;
-
Achso. Gut.
Werde das nachher mal einbauen und vilen Dank bis hierher
Edit://
Funktioniert perfekt
-
Wenn keine Zufallsbilder vorhanden sind kommt folgender Fehler:
Notice: Undefined index: no_random_images in /www/htdocs/XXXXX/XXXXX/includes/page_header.php on line 274
-
füge das mal in die lang/main.php ein:
$lang['no_random_images'] = "Keine Bilder vorhanden";
-
Teste ich gleich mal!
Aber sag mal, ist es auch möglich die Namen zu kürzen?
-
can i show this on Details.php ? :roll:
-
can i show this on Details.php ? :roll:
Yes, you can show it on detail page also... you need to use that new tag {random_images} ...
-
Thanks ,, i tried it,, it ddnt work ,, ill try it again :wink:
-
Hallo zusammen
Wie kriege ich es hin das die bilder auf einer Reihe sind und nicht untereinander?
Kannst Du mir helfen bitte?
Lg Vitara
-
Hi, I can't seem to be able to get this going on version 1.8 :?
Any suggestions would be appreciated!!!
Thanx,
Brian
-
Hello,
Nothing happens here in the forum anymore, everyone has withdrawn.
nobby
-
Not everyone, yet...
Look what he has now to play with:
https://www.maui-tropica.com/maui-tropica-gallery/nextgen/
:lol: