Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 03 Jul 2012, 22:20
stryka stryka is offline
 
Join Date: Aug 2002
Random background image with PHP

I currently have a PHP function that does a directory scan and randomly pulls an image to appear in the background CSS tag...

It essentially creates the following entry before the BODY tag


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Any idea how i can do this in VB3.8?

Thanx
Reply With Quote
  #2  
Old 03 Jul 2012, 23:12
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Try creating a new plugin using hook parse_templates and code like this (insert your function at the comment):


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread.

Last edited by kh99 : 03 Jul 2012 at 23:27.
Reply With Quote
  #3  
Old 04 Jul 2012, 22:55
stryka stryka is offline
 
Join Date: Aug 2002
hmm... I think I lost you... what value does $str need to be for it to work?

is this the value i am sending


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #4  
Old 04 Jul 2012, 23:03
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
$str would have to be the entire thing you posted in the first post. If your function is only returning the part you posted above, then try this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Also, I was assuming that your function output a string. If it returns a string, then you don't need the ob_start()/ob_end_clean() calls.
__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread.
Reply With Quote
  #5  
Old 04 Jul 2012, 23:24
stryka stryka is offline
 
Join Date: Aug 2002
ahh... so my plugin would look like this...


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #6  
Old 04 Jul 2012, 23:27
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Looks good, except the post is missing the last } .
__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread.
Reply With Quote
  #7  
Old 04 Jul 2012, 23:45
stryka stryka is offline
 
Join Date: Aug 2002
Darn... the entry is getting inserted into the HTML when i view source... but the page isn't taking the value and showing the image... i even tried deleting the "background" value in style template of admincp... hmmmm.... so close
Reply With Quote
  #8  
Old 04 Jul 2012, 23:56
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
What does it look like when you view the html? Looking more closely at the function you posted, I don't see where the "background-image: url(" and the closing ")" come from - maybe those need to be added to the plugin code?
__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread.
Reply With Quote
  #9  
Old 05 Jul 2012, 10:54
stryka stryka is offline
 
Join Date: Aug 2002
yup.. that was it.. i usually dont get much help in this forum....

THanks for the help!

Originally Posted by kh99 View Post
What does it look like when you view the html? Looking more closely at the function you posted, I don't see where the "background-image: url(" and the closing ")" come from - maybe those need to be added to the plugin code?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 02:27.

Layout Options | Width: Wide Color: