4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Rembrandt on October 31, 2009, 05:13:37 PM



Title: [MOD] Random Slide
Post by: Rembrandt on October 31, 2009, 05:13:37 PM
Hi!

Mit dieser Modifikation wird das Random Bild zur Slideshow.

Neue Dateien:
fadeslideshow.js
jquery.min.js

Demo:demo.vienna-pictures (http://www.demo.vienna-pictures.com/index.php)

1.) erstellt einen neuen Ordner in euren root Ordner "js/fade_slide".

2.)lade euch die beiden Dateien "fadeslideshow.js" (http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm) und "jquery.min.js" (http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js) und die im anhang befindlichen
png bilder herrunter, und Speicher sie in den neu erstellten Ordner "js/fade_slide" ab.


3.) wenn ihr die Slideshow nur auf eurer home.html sehen wollt, sucht in der index.php:
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

und fügt darüber ein:
//#################################### Start Random Slide Show #################################################

$sql = "SELECT image_id, cat_id, user_id, image_name, image_media_file
        FROM ".IMAGES_TABLE."
        WHERE image_active = 1 AND cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").") AND image_media_file LIKE '%.jpg'
        ORDER BY RAND()
        LIMIT 30";
        $result = $site_db->query($sql);
     $minis = "";
 while($row = $site_db->fetch_array($result))
   {
     $minis .= "[\"./".THUMB_DIR."/".$row['cat_id']."/".$row['image_media_file']."\",";
     $minis .= "\"".$site_sess->url($script_url."/details.php?".URL_IMAGE_ID."=".$row['image_id'])."\",\"\"";
  //$minis .= ",\"".$row['image_name']."\"";
     $minis .= "],";
   }
     $minis = substr($minis, 0, -1);
     $max_width = $config['max_thumb_width'];
     $max_hight = $config['max_thumb_height'];
     $minislide ="
    <script type=\"text/javascript\">
     var mygallery=new fadeSlideShow({
      wrapperid: \"fadeshow\",
      dimensions: [$max_width, $max_hight],
      imagearray: [$minis],
      displaymode: {type:'auto', pause:1000, cycles:0, wraparound:true},
      fadeduration: 600,
      togglerid: \"fadeshowtoggler\"
     })
    </script>";
$minislide .= "<div class=\"head1\">";
$minislide .= "<span style=\"line-height:20px;vertical-align:middle;margin-left:3px;\">".$lang['random_image']."</span>";
$minislide .= "</div>";
$minislide .= "<div style=\"width:$max_width px;background-color:#e1e1e1\">";
$minislide .= "<div id=\"fadeshow\" style=\"margin-top:3px;\"></div>";
$minislide .= "<div id=\"fadeshowtoggler\" style=\"width:$max_width px;\">";
$minislide .= "<span style=\"float:left;margin-left:27px;margin-top:3px;\"><a href=\"#\" class=\"prev\"><img src=\"./js/fade_slide/bwd.png\" style=\"border-width:0;\" alt=\"prev\"></a></span>";
$minislide .= "<span class=\"status\" style=\"float:left;margin-top:3px;text-indent:3px;font-weight:lighter;\"></span>";
$minislide .= "<span style=\"float:right;margin-right:27px;margin-top:3px;\"><a href=\"#\" class=\"next\"><img src=\"./js/fade_slide/fwd.png\" style=\"border-width:0\" alt=\"next\"></a></span>";
$minislide .= "</div>";
$minislide .= "</div>";
$site_template->register_vars("minislide", $minislide);
//#################################### End Random Slide Show #################################################

wenn ihr die slideshow in all euren Template Dateien sehen wollt (home.- categorie.- details.htlm) dann sucht in der "includes/page_header.php":
//-----------------------------------------------------
//--- Register Global Vars ----------------------------
//-----------------------------------------------------

und fügt den code darüber ein.

4.) sucht in der header.html:
1
{if has_rss}

und fügt darüber ein:
1
2
3
4
5
6
7
8
<script type="text/javascript" src="./js/fade_slide/jquery.min.js"></script>
<script type="text/javascript" src="./js/fade_slide/fadeslideshow.js">
/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>

5.) in all euren templates Dateien wo ihr die Slideshow sehen wollt, sucht:
1
{endif random_image}

und fügt darunter ein:
1
2
<br>
{minislide}

in der includes/constants.php könnt ihr jetzt random image auf "0" setzen.
define('SHOW_RANDOM_IMAGE', 0);

Viel Spass!

mfg Andi


Title: Re: [MOD] Random Slide
Post by: Sumale.my on October 31, 2009, 06:53:18 PM
Cool, danke!


Title: Re: [MOD] Random Slide
Post by: GaYan on November 01, 2009, 03:17:58 AM
im sorry to say..
the template is messed up after instaling it correctly...please help me to get rid of this gray border... i have attached a screen shot..then u will understand

i changed every code u gave and treid to remove this border..but i faild :(
pls help :)

tnx in advance !




Title: Re: [MOD] Random Slide
Post by: Rembrandt on November 01, 2009, 08:39:44 AM
Hi!
....
i changed every code u gave and treid to remove this border..but i faild :(...
set in ACP/General/Settings "Max. width of thumbnail in pixel" and "Max. heigth of thumbnail in pixel".

or in the code, search:
$max_width = $config['max_thumb_width'];
$max_hight = $config['max_thumb_height'];

replace it with:
$max_width = "150";
$max_hight = "150";

mfg Andi



Title: Re: [MOD] Random Slide
Post by: GaYan on November 02, 2009, 05:51:39 AM
Hey..How to remove that gray colour border from it :( ? thanks !

i want to show the image and navigation buttons only :)


Title: Re: [MOD] Random Slide
Post by: Rembrandt on November 02, 2009, 06:05:28 AM
Hey..How to remove that gray colour border from it :( ? thanks !

i want to show the image and navigation buttons only :)
search in "fadeslideshow.js:
1
.css({position:'absolute', left:0, top:0, width:'100%', height:'100%', background:'#e1e1e1'})
change the value for background.


Title: Re: [MOD] Random Slide
Post by: GaYan on November 02, 2009, 06:18:23 AM
Thanks.. I Found A Small Bug :D

1
$minis .= "\"".SCRIPT_URL."/details.php?".URL_IMAGE_ID."=".$row['image_id']."\",\"\"";

must be changed it to
1
$minis .= "\"".$script_url."/details.php?".URL_IMAGE_ID."=".$row['image_id']."\",\"\"";

Thanks..


Title: Re: [MOD] Random Slide
Post by: Rembrandt on November 02, 2009, 06:54:06 AM
"SCRIPT_URL" is defined in constans.php


Title: Re: [MOD] Random Slide
Post by: GaYan on November 02, 2009, 08:58:07 AM
hey..it ddnt work for me :( so i just pasted this code ...i mean the above code...then it worked.....  :idea:


Title: Re: [MOD] Random Slide
Post by: nameless on November 27, 2009, 06:06:51 PM
English Pleeeeeeeeeas

Pleeeeeas

i did it but there is a problem i'm useing short URL and it does't work with it

so i need help


Title: Re: [MOD] Random Slide
Post by: V@no on November 27, 2009, 08:27:37 PM
"SCRIPT_URL" is defined in constans.php
By default it doesn't


Title: Re: [MOD] Random Slide
Post by: Rembrandt on November 27, 2009, 08:34:00 PM
you're right, I changed it.

mfg Andi


Title: Re: [MOD] Random Slide
Post by: arabcine on December 04, 2009, 07:30:56 PM
i can't understand this lang, please can you do this by english?


Title: Re: [MOD] Random Slide
Post by: V@nо on December 04, 2009, 08:52:40 PM
see the language translation tool on top of the page?


Title: Re: [MOD] Random Slide
Post by: GaYan on December 06, 2009, 05:50:40 PM
can we show this on a external web site  :roll:


Title: Re: [MOD] Random Slide
Post by: Steffen13 on January 31, 2010, 11:19:48 AM
Hi,

ich habe den Mod eingebaut, und es funktioniert auch.
Aber eine Sache habe ich. Und zwar; wird ein Bild im Querformat geladen, und anschl. eins im Hochformat, sieht man links und rechts noch das vorherige Bild dahinter.

Was habe ich falsch gemacht?

Ein kleiner Anhang:

(http://www.goeff.de/bilder/slide.jpg)

Grüße


Title: Re: [MOD] Random Slide
Post by: Rembrandt on January 31, 2010, 05:56:39 PM
diesen effect hatte ich beim erstellen des mods auch, leider weis ich im moment nicht woran es lag.


Title: Re: [MOD] Random Slide
Post by: MrAndrew on July 22, 2010, 08:09:27 PM
Thanks for this great mod.

But i have 250px of my thumbnail in my gallery. I need to show slides with 150px width proportionally! How to do this?  :(


Title: Re: [MOD] Random Slide
Post by: Rembrandt on July 23, 2010, 07:31:50 AM
....But i have 250px of my thumbnail in my gallery. I need to show slides with 150px width proportionally! How to do this?  :(

search in fadeslideshow.js:
1
layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0;" />\n'
and replace:
1
layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0;width:150px" />\n'

mfg Andi


Title: Re: [MOD] Random Slide
Post by: MrAndrew on September 21, 2010, 09:29:24 PM
Where should be this param that to open in new blank? " target="_blank" "??


Title: Re: [MOD] Random Slide
Post by: V@no on September 21, 2010, 09:48:30 PM
in index.php replace

     $minis .= "\"".$site_sess->url($script_url."/details.php?".URL_IMAGE_ID."=".$row['image_id'])."\",\"\"";
with:
     $minis .= "\"".$site_sess->url($script_url."/details.php?".URL_IMAGE_ID."=".$row['image_id'])."\",\"_blank\"";


Title: Re: [MOD] Random Slide
Post by: ASAD on October 28, 2010, 10:41:31 PM
hi,
wie kann ich das korrigieren?
das "button" zeigt so in IE und das foto in brauzer ie, ff, opera

danke


Title: Re: [MOD] Random Slide
Post by: Rembrandt on October 29, 2010, 05:43:02 AM
du kannst das hier versuchen:
http://www.4homepages.de/forum/index.php?topic=26198.msg142640#msg142640

und im code:
1
margin-left:27px;
den wert verringern z.b. 20px


Title: Re: [MOD] Random Slide
Post by: ASAD on October 30, 2010, 07:32:12 AM
Danke!
das hielft

1
2
$max_width = "150";
$max_hight = "150";