Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Random Banner/Reply BG Details »»
Random Banner/Reply BG
Version: , by Shpookdefied Shpookdefied is offline
Developer Last Online: Apr 2004 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-06-2003 Last Update: Never Installs: 0
 
No support by the author.

I am customizing Mist's Random Banner hack for use in Firefly's Fast Reply. I'm trying to get the textarea background to come up as random BG's, but it doesnt seem to be working. This is what I have in showthread.php:

PHP Code:
//Define Variables //
$qrback[1]="qrback1.jpg";
$qrback[2]="qrback2.jpg";
$qrback[3]="qrback3.jpg";
$qrback[4]="qrback4.jpg";
$numbgs count($qrback);

// Generate randomness
$num rand(1,$numbgs);

//output background
$qrback "{imagesfolders}/qrback$num"
And this is in the showthread_replybox template:

PHP Code:
<textarea name="message" rows="9" cols="$textareacolswrap="virtual" tabindex="1"  style="background-image: url('$qrback'); 
background-repeat: no-repeat; background-attachment: fixed"
></textarea
I have also tried this in showthread.php:

PHP Code:
//output background
$qrback "<textarea name="message" rows="9" cols="$textareacols" wrap="virtual" tabindex="1"
  style="
background-imageurl('qrback$num); background-repeat: no-repeat; background-attachment: fixed"></textarea>"; 
And this in showthread_replybox:

PHP Code:
<td>$qrback><br><smallfont><a href="javascript:checklength(document.vbform);">[check message length]</a></smallfont></td
I'm not very good with PHP, so I have no clue why it's not working. Can anyone help?

And btw, I am not and will not take credit for this if/when I get it to work. Mist can release it as his own if he wishes.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-06-2003, 06:30 PM
Shpookdefied Shpookdefied is offline
 
Join Date: Jan 2003
Location: South Florida
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BTW, In showthread.php, I've placed the code underneath this:

PHP Code:
        eval("\$replybox = \"".gettemplate('showthread_replybox')."\";");

Reply With Quote
  #3  
Old 02-06-2003, 09:18 PM
mr e's Avatar
mr e mr e is offline
 
Join Date: Dec 2001
Posts: 461
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dont you need ".jpg" on the end? also you could do it like this

PHP Code:
// Generate randomness
$num rand(1,4); //make max number the number of images you have

//output background
$qrback "{imagesfolders}/qrback$num.jpg"
Reply With Quote
  #4  
Old 02-06-2003, 10:49 PM
Shpookdefied Shpookdefied is offline
 
Join Date: Jan 2003
Location: South Florida
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, from my understand, the file is defined here:

PHP Code:
$qrback[1]="qrback1.jpg"
so qrback$num would define the $qrback call as qrback1.jpg

Also,
PHP Code:
$num rand(1,4); 
is doing the same thing as
PHP Code:
$numbgs count($qrback);

// Generate randomness
$num rand(1,$numbgs); 
But in the bottom example, it just counts the number of variables and applies the randomization to that. Just about the same thing, except you don't have to set the rand max number when adding a new variable.

So I've tried a few different things, still to no avail. But I WILL have this working before I put my board up
Reply With Quote
  #5  
Old 02-07-2003, 12:03 AM
mr e's Avatar
mr e mr e is offline
 
Join Date: Dec 2001
Posts: 461
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i know i have to set the max number, but i dont have to type each file in, that part doesn't matter, if you want to do it your way do this

PHP Code:
//Define Variables //
$qrback[1]="qrback1.jpg";
$qrback[2]="qrback2.jpg";
$qrback[3]="qrback3.jpg";
$qrback[4]="qrback4.jpg";
$numbgs count($qrback);

// Generate randomness
$num rand(1,$numbgs);

//output background
$qrback "{imagesfolders}/$qrback[$num]"
most of this is just repetitive, you could just randomize the number, your way only REALLY matters if they were named for ex: boat.jpg, plane.gif, since then you'd have to define the names somehow, you have all the names "qrback#.jpg" so my way would be faster
Reply With Quote
  #6  
Old 02-07-2003, 03:33 AM
Shpookdefied Shpookdefied is offline
 
Join Date: Jan 2003
Location: South Florida
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I see what your saying now. I misunderstood you at first. Let me go give this a try, and I'll come back with the results.
Reply With Quote
  #7  
Old 02-07-2003, 09:05 PM
Shpookdefied Shpookdefied is offline
 
Join Date: Jan 2003
Location: South Florida
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, well I've tried, still nothing. I'm not getting any errors, but the BG just isnt showing up. Help?
Reply With Quote
  #8  
Old 02-08-2003, 04:41 AM
mr e's Avatar
mr e mr e is offline
 
Join Date: Dec 2001
Posts: 461
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

are you sure the html for the bg is correct?

try this for the code in showthread.php

above this
PHP Code:
eval("dooutput(\"".gettemplate("showpost")."\");"); 
put this
PHP Code:
    // Generate randomness
    
$num rand(1,4); //make max number the number of images you have

    //output background
    
$qrback "{imagesfolders}/qrback$num.jpg"
haven't tested it, but try that and make sure the html is correct
Reply With Quote
  #9  
Old 02-08-2003, 04:13 PM
Shpookdefied Shpookdefied is offline
 
Join Date: Jan 2003
Location: South Florida
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Above? Hmmm, I assumed below. Okay, I'll go give it a shot.
Reply With Quote
  #10  
Old 02-14-2003, 08:44 PM
Dpcows Dpcows is offline
 
Join Date: Feb 2002
Location: Netherlands
Posts: 143
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Shpookdefied

PHP Code:
//Define Variables //
$qrback[1]="qrback1.jpg";
$qrback[2]="qrback2.jpg";
$qrback[3]="qrback3.jpg";
$qrback[4]="qrback4.jpg";
$numbgs count($qrback);

// Generate randomness
$num rand(1,$numbgs);

//output background
$qrback "{imagesfolders}/qrback$num"
i think you need to look at your arrays.
the way you make then is good, but displaying it isn't it.

your doing this: qrback$num
this will generate: qrback1 or qrback2 and increase the numbers to the max you have set. your just telling it to show $num with qrback before it.

not showing anything from the array

to do the array correclty: $array_name[$value].
so for you it would be: $qrback[$num].
that would show them

hope this helps
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:08 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07640 seconds
  • Memory Usage 2,325KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (13)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete