View Full Version : Random Link on a page not located in the directory
jgsketch
04-04-2006, 08:12 PM
I found a random link mod that I like: {thread no longer in service}. But I would like to place on my front page of my site which is not part of the directory. I'm not sure how to incorporate the code so that the link shows up outside of the directory. Any help would be great. Thanks.
what you need is a perl script to randomize links or an external call to a specified php file.
bobby9101
04-05-2006, 12:46 AM
yes, it can be done
i may have to check, but this should work on your site
<?php include 'http://www.yoursite.com/random.php';?>
jgsketch
04-05-2006, 07:56 PM
Thanks for the replys. I tried the include, but it did not work. I was not sure how to combine the code. What I did was I took this code
Content visible to registered users only.
and added this part of the code since I was not going to put it on my main.tpl
Content visible to registered users only.
So maybe my mistake is in how I combined the two.
As for the Perl I'll have to do some research, I no nothing about Pearl. Thanks.
Hello!
Here is a random link generator I wrote about a month or two ago for a user.
Content visible to registered users only.
Now, there are two ways to display this on your homepage, but only if it's running on the same server, better...if the directory is installed in a subdirectory of your homepage (your-homepage.com and your-homepage.com/directory/)
You put now the above code in a file random.php that is located in the folder where your directory is installed and on your homepage where you want the link to be displayed:
Content visible to registered users only.
Another more easy way is to put all the above code in the file of your homepage and change the paths to config.php and adodb.inc.php
It should look something like this:
Content visible to registered users only.
If you want, I can write you a more simple code that does not use the config file and the AdoDB library.
If your homepage is located on another server, make sure you can connect to your database from outside, then you can have same results on any page anywhere.
Boby
jgsketch
04-06-2006, 03:16 AM
Wonderfull. It works great. Thank you very much. :P :P :P
Are there any disadvantages to using the config file and the AdoDB library? Thanks. Also, I was trying to include the description, but I think I'm getting the punctuation wrong. Is it possible to add the description?
Content visible to registered users only.
Glad it works :D
Content visible to registered users only.
Nope! Only advantages ;)
Content visible to registered users only.
Sure, just replace the echo line with this:
Content visible to registered users only.
Cheers, Boby.
jgsketch
04-06-2006, 01:02 PM
Ahh, Thank you, I did have some brackets missing. That did it. Thanks for your help.
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.