Hot Topic (More than 10 Replies) Yabblogo.png Randomizer (Read 28033 times)
Paste Member Name in Quick Reply Box Red Barchetta
New Member
*
Offline


I Love YaBB 2.6.0!

Posts: 31
Location: Florida, USA
Country: United States
Map:
Joined: Juni 15th, 2014
Geschlecht: männlich
Yabblogo.png Randomizer
Juni 19th, 2014 um 4:57am
Beitrags-Werkzeuge
I have what I hope is a simple request. I would like to have a pool, or folder of images that will randomly load on the Forum header in place of the Yabblogo.png image. Simple, or not?

Thanks.

David
  

Running YABB 2.6.11 - Florida Classic & Muscle
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box pyragony54
New Member
*
Offline


I Love YaBB 2.6.0!

Posts: 45
Location: Aerzen
Country: Germany
Map:
Joined: Mai 16th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #1 - Juni 19th, 2014 um 5:31pm
Beitrags-Werkzeuge
Hi David

Not particularly difficult. You have to adapt only in the default.html the following line.

Quote:
../Templates/default/default.html


or in the Admin Center

Code
Select All
<a href="http://www.yabbforum.com"><img src="{yabb images}/yabblogo_26.png" alt="YaBB - Yet another Bulletin Board" title="YaBB - Yet another Bulletin Board" /></a> 

« Last Edit: Juni 19th, 2014 um 5:32pm by pyragony54 »  
Back to top
 
IP Logged
 
Paste Member Name in Quick Reply Box Red Barchetta
New Member
*
Offline


I Love YaBB 2.6.0!

Posts: 31
Location: Florida, USA
Country: United States
Map:
Joined: Juni 15th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #2 - Juni 23rd, 2014 um 5:28am
Beitrags-Werkzeuge
I know the line and location of the file. I need the code to add a randomize to it. Like "yabblogo_"+XX".png" where XX is the random number.   Wink
  

Running YABB 2.6.11 - Florida Classic & Muscle
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box ..::X.T.C::..
Forum Administrator
*****
Offline


I love YaBB 2.6.0!

Posts: 116
Location: @ustria
Country: Austria
Map:
Joined: Februar 25th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #3 - Juni 24th, 2014 um 9:35pm
Beitrags-Werkzeuge
« Last Edit: Juni 24th, 2014 um 9:37pm by ..::X.T.C::.. »  

The Administrator.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Red Barchetta
New Member
*
Offline


I Love YaBB 2.6.0!

Posts: 31
Location: Florida, USA
Country: United States
Map:
Joined: Juni 15th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #4 - Juni 25th, 2014 um 2:18am
Beitrags-Werkzeuge
Thanks, I will work with that and see what damage I can do. Grin
  

Running YABB 2.6.11 - Florida Classic & Muscle
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Red Barchetta
New Member
*
Offline


I Love YaBB 2.6.0!

Posts: 31
Location: Florida, USA
Country: United States
Map:
Joined: Juni 15th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #5 - Juni 29th, 2014 um 5:08am
Beitrags-Werkzeuge
I look around and see others using an array of image names in the java script. I want to use a directory that has "logo_xx.png" files where xx = 10 - 99. I found out how to generate the variable xx, but not how to insert it into the code to draw the proper random image.

Code (Java)
Select All
<script type="text/javascript">
var num = Math.floor(Math.random() * 90 + 10)

<a href="https://www.facebook.com/groups/soflclassicmuscle/"><img src="{yabb images}/logo/logo_" + var + ".png" alt="South Florida Classic & Muscle" title="South Florida Classic & Muscle" /></a>

</script> 

  

Running YABB 2.6.11 - Florida Classic & Muscle
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box ..::X.T.C::..
Forum Administrator
*****
Offline


I love YaBB 2.6.0!

Posts: 116
Location: @ustria
Country: Austria
Map:
Joined: Februar 25th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #6 - Juni 29th, 2014 um 7:36am
Beitrags-Werkzeuge
Hello

Red Barchetta wrote on Juni 29th, 2014 um 5:08am:
Code (Java)
Select All
<script type="text/javascript">
var num = Math.floor(Math.random() * 90 + 10)

<a href="https://www.facebook.com/groups/soflclassicmuscle/"><img src="{yabb images}/logo/logo_" + var + ".png" alt="South Florida Classic & Muscle" title="South Florida Classic & Muscle" /></a>

</script> 


Have not test, but you should insert "num" not "var" ...

Code (Java)
Select All
<script type="text/javascript">
var num = Math.floor(Math.random() * 90 + 10)

<a href="https://www.facebook.com/groups/soflclassicmuscle/"><img src="{yabb images}/logo/logo_" + num + ".png" alt="South Florida Classic & Muscle" title="South Florida Classic & Muscle" /></a>

</script> 



"var" == variable "num"

lg XTC
  

The Administrator.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Red Barchetta
New Member
*
Offline


I Love YaBB 2.6.0!

Posts: 31
Location: Florida, USA
Country: United States
Map:
Joined: Juni 15th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #7 - Juni 29th, 2014 um 6:42pm
Beitrags-Werkzeuge
didnt get something right, no logo images are showing. Can I make it print to the screen the name of the image its trying to load?
  

Running YABB 2.6.11 - Florida Classic & Muscle
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box ..::X.T.C::..
Forum Administrator
*****
Offline


I love YaBB 2.6.0!

Posts: 116
Location: @ustria
Country: Austria
Map:
Joined: Februar 25th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #8 - Juni 29th, 2014 um 7:14pm
Beitrags-Werkzeuge
Have you a link to the forum?

lg XTC
  

The Administrator.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Red Barchetta
New Member
*
Offline


I Love YaBB 2.6.0!

Posts: 31
Location: Florida, USA
Country: United States
Map:
Joined: Juni 15th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #9 - Juni 29th, 2014 um 11:10pm
Beitrags-Werkzeuge
Mine is at http://red.wow64.net/sfcm/YaBB.pl

Though due to the small size of the images I have now modified the code to have 2 images. I will be re-sizing them all to the same height for better appearance. The randomazation is currently not in. It seems to be something other than the insertion of the "num" variable as even when I replaced only that part of the code with the original yabblogo_26.png it still did not show.
  

Running YABB 2.6.11 - Florida Classic & Muscle
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Red Barchetta
New Member
*
Offline


I Love YaBB 2.6.0!

Posts: 31
Location: Florida, USA
Country: United States
Map:
Joined: Juni 15th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #10 - Juli 2nd, 2014 um 3:20am
Beitrags-Werkzeuge
The forum suddenly started running 500 errors and I had to restore it back to the stock files.
  

Running YABB 2.6.11 - Florida Classic & Muscle
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box ..::X.T.C::..
Forum Administrator
*****
Offline


I love YaBB 2.6.0!

Posts: 116
Location: @ustria
Country: Austria
Map:
Joined: Februar 25th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #11 - Juli 9th, 2014 um 6:29pm
Beitrags-Werkzeuge
Hi

Did you get it?

Here a test (forum) code  Wink

http://www.xonder.com/cgi-bin/yabbutf8/YaBB.pl

default.html

search for ....

Code (HTML)
Select All
<a href="http://www.yabbforum.com"><img src="{yabb images}/yabblogo_26.png" alt="YaBB - Yet another Bulletin Board" title="YaBB - Yet another Bulletin Board" /></a> 



and replace with ....

Code (Javascript)
Select All
<script type="text/javascript">
	var total_images = 3;
	var random_number = Math.floor((Math.random()*total_images));
	var random_img = new Array();
	   random_img[0] = '<a href="http://www.xonder.com/cgi-bin/yabb26/YaBB.pl"><img src="{yabb images}/logo33.png"></a>';
	   random_img[1] = '<a href="http://www.xonder.com/cgi-bin/yabb26/YaBB.pl"><img src="{yabb images}/yabblogo_26.png"></a>';
	   random_img[2] = '<a href="http://www.xonder.com/cgi-bin/yabb26/YaBB.pl"><img src="{yabb images}/logo34.png"></a>';
	document.write(random_img[random_number]);
</script> 



lg XTC
  

The Administrator.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Red Barchetta
New Member
*
Offline


I Love YaBB 2.6.0!

Posts: 31
Location: Florida, USA
Country: United States
Map:
Joined: Juni 15th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #12 - Juli 10th, 2014 um 1:28am
Beitrags-Werkzeuge
Just put your code in but made it 50 images. I have more so I hope the size of the template file does not become an issue.

Code (Java)
Select All
<script type="text/javascript">
	var total_images = 50;
	var random_number = Math.floor((Math.random()*total_images));
	var random_img = new Array();
	   random_img[0] = '<a href="https://www.facebook.com/groups/soflclassicmuscle/"><img src="{yabb images}/logo/logo10.png" alt="South Florida Classic & Muscle" title="South Florida Classic & Muscle" /></a>';
.
.
.
	   random_img[49] = '<a href="https://www.facebook.com/groups/soflclassicmuscle/"><img src="{yabb images}/logo/logo59.png" alt="South Florida Classic & Muscle" title="South Florida Classic & Muscle" /></a>';
	document.write(random_img[random_number]);
</script> 



Thanks, that makes it do what I wanted.   Smiley
  

Running YABB 2.6.11 - Florida Classic & Muscle
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Red Barchetta
New Member
*
Offline


I Love YaBB 2.6.0!

Posts: 31
Location: Florida, USA
Country: United States
Map:
Joined: Juni 15th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #13 - Juli 10th, 2014 um 1:29am
Beitrags-Werkzeuge
You can see it working here:

http://red.wow64.net/sfcm/YaBB.pl
  

Running YABB 2.6.11 - Florida Classic & Muscle
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Red Barchetta
New Member
*
Offline


I Love YaBB 2.6.0!

Posts: 31
Location: Florida, USA
Country: United States
Map:
Joined: Juni 15th, 2014
Geschlecht: männlich
Re: Yabblogo.png Randomizer
Reply #14 - September 7th, 2014 um 9:02pm
Beitrags-Werkzeuge
Ok, another modification to the random Images. As I have two of them, I need to make sure they both do not end up the same. Here is a small snippit of the code between the two images:

Code
Select All
	   random_img[60] = '<a href="https://www.facebook.com/groups/soflclassicmuscle/"><img src="{yabb images}/logo/logo70.png" alt="South Florida Classic & Muscle" title="South Florida Classic & Muscle" /></a>';
	document.write(random_img[random_number1]);
</script>
                    </td>
                    <td class="right" rowspan="2" align right>
                      <script type="text/javascript">
	var total_images = 61;
	var random_number2 = Math.floor((Math.random()*total_images));
	var random_img = new Array();
	   random_img[0] = '<a href="https://www.facebook.com/groups/soflclassicmuscle/"><img src="{yabb images}/logo/logo10.png" alt="South Florida Classic & Muscle" title="South Florida Classic & Muscle" /></a>'; 



How would I go about adding and if/then like

if random_number1 = random_number2 then goto 'some mark'

??
  

Running YABB 2.6.11 - Florida Classic & Muscle
Back to top
WWW  
IP Logged
 
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo
Yabblogo.png Randomizer
Open Preview Preview

You can resize the textbox by dragging the right or bottom border.
Insert Hyperlink Insert FTP Link Insert Image Insert E-mail Insert Media Insert Table Insert Table Row Insert Table Column Insert Horizontal Rule Insert Teletype Insert Code Insert Quote Edited Superscript Subscript Insert List /me - my name Insert Marquee Insert Timestamp No Parse
Bold Italicized Underline Insert Strikethrough Highlight
                       
Insert Preformatted Text Left Align Centered Right Align
resize_wb
resize_hb







Max 5000 characters. Remaining characters:
Text size: pt
More Smilies
View All Smilies
Collapse additional features Collapse/Expand additional features Smiley Wink Cheesy Grin Angry Sad Shocked Cool Huh Roll Eyes Tongue Embarrassed Lips Sealed Undecided Kiss Cry

 
 
  « Board Index ‹ Forum Top