![]() |
|
|
Thread Tools |
|
#1
|
||||
|
||||
|
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
Any idea how i can do this in VB3.8? Thanx No members have liked this post.
|
||||
|
#2
|
||||
|
||||
|
Try creating a new plugin using hook parse_templates and code like this (insert your function at the comment):
__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread. No members have liked this post.
Last edited by kh99 : 03 Jul 2012 at 23:27. |
||||
|
#3
|
||||
|
||||
|
hmm... I think I lost you... what value does $str need to be for it to work?
is this the value i am sending
No members have liked this post.
|
||||
|
#4
|
||||
|
||||
|
$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:
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. No members have liked this post.
|
||||
|
#5
|
||||
|
||||
|
ahh... so my plugin would look like this...
No members have liked this post.
|
||||
|
#6
|
||||
|
||||
|
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. No members have liked this post.
|
|
#7
|
|||
|
|||
|
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
No members have liked this post.
|
|
#8
|
||||
|
||||
|
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. No members have liked this post.
|
|
#9
|
|||
|
|||
|
yup.. that was it.. i usually dont get much help in this forum....
THanks for the help! No members have liked this post.
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
| Thread Tools | |
|
|
| New To Site? | Need Help? |
All times are GMT. The time now is 02:27.



