This is weird. I have assigned an array, or 1 to 5, yet some how its sending back a 0! I am using the 2nd to last line to do the debugging, and when nothing is assigned, it just reports back the number, which is 0. Am I doing something wrong?
my @array = (1..5); # deifne the numbers we need for the array
my $rand_number = int(rand scalar(@array)); # get the random number...
my $text = $opts->{'Text_' . $rand_number};
my $text_url = $opts->{'Text_' . $rand_number . '_Image'};
my $html = "[ <a href=\"$text_url\" target=\"_new\"><font face=\"Tahoma\" style=\"font-size: 9pt\">$text</font></a> ]";
if (!$text_url) { $html = $rand_number; }
return $html;
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
my $opts = Links::Plugins->get_plugin_user_cfg('Basic_Banner'); my @array = (1..5); # deifne the numbers we need for the array
my $rand_number = int(rand scalar(@array)); # get the random number...
my $text = $opts->{'Text_' . $rand_number};
my $text_url = $opts->{'Text_' . $rand_number . '_Image'};
my $html = "[ <a href=\"$text_url\" target=\"_new\"><font face=\"Tahoma\" style=\"font-size: 9pt\">$text</font></a> ]";
if (!$text_url) { $html = $rand_number; }
return $html;
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!