Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Javascript Help (Read 3727 times)
Shoeb Omar
God Member
*****
Offline


Mod Writer

Posts: 5665
Location: San Diego
Joined: Jun 29th, 2001
Gender: Male
Javascript Help
Apr 13th, 2002 at 11:42pm
Print Post  
frick frick frick frick frick.

i thought i couldve released add smilies 2 beta today bu after 2 hours i cant work this darn thing out:

i have htis code:

$yymain  .= qq~          document.write("<img src='$smiliesdir/$line' align=bottom alt='$name' border='0' onclick='javascript:Smiliextra($line)' style='cursor:hand'>$SmilieLinebreak[$i] ");\n~;

which keeps bustin gout erors for me, whether i put quotes rond $line$ or not..

while this code:

$yymain  .= qq~          document.write("<img src='$smiliesdir/$line' align=bottom alt='$name' border='0' onclick='javascript:Smiliextra()' style='cursor:hand'>$SmilieLinebreak[$i] ");\n~;

without anythign in the arantheses for SmilieExtra works fine! Cry

please help - its beyond annnoying
  

YaBB SP2 BETA!
Now taking pay jobs in PHP or Perl.  Contact me for details.
Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: Javascript Help
Reply #1 - Apr 14th, 2002 at 12:46am
Print Post  
What have you been doing to the code I sent you? You've been trying to fix the animation stopping problem again, haven't you!

So,
1...what's the error message?
2...where is this code being used?
3...what's the Smilieextra function?
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Shoeb Omar
God Member
*****
Offline


Mod Writer

Posts: 5665
Location: San Diego
Joined: Jun 29th, 2001
Gender: Male
Re: Javascript Help
Reply #2 - Apr 14th, 2002 at 1:12am
Print Post  
1. error message is with a blank line.... says syntax error yet the line it points to reads: (nothing)

2.  this code i sbeing used right after the default smilies, a listing of the smiliesdir smilies Smiley

3. the one you made which adds Smiley[/smiley]

hehe.. just adding more features Tongue
  

YaBB SP2 BETA!
Now taking pay jobs in PHP or Perl.  Contact me for details.
Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: Javascript Help
Reply #3 - Apr 14th, 2002 at 1:20am
Print Post  
use the MoreSmilies function and load the additional smilie codes (Smiley) into the moresmiliecode array ($more_smilie_code_array)


(Omario should know what I mean, even if no-one else does!)
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Shoeb Omar
God Member
*****
Offline


Mod Writer

Posts: 5665
Location: San Diego
Joined: Jun 29th, 2001
Gender: Male
Re: Javascript Help
Reply #4 - Apr 14th, 2002 at 1:26am
Print Post  
hehe - ok ill give that ashot even if it is tons more work then i wanted Wink
  

YaBB SP2 BETA!
Now taking pay jobs in PHP or Perl.  Contact me for details.
Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: Javascript Help
Reply #5 - Apr 14th, 2002 at 1:30am
Print Post  
Code
Select All
	  <script language="JavaScript1.2" type="text/javascript">
	  <!--
~;
	$moresmilieslist = "";
	$more_smilie_array = "";
	$i=0;
	while($SmilieURL[$i]) {
		$moresmilieslist .= qq~	     document.write("<a href=javascript:MoreSmilies($i)><img src='$imagesdir/$SmilieURL[$i]' align=bottom alt='$SmilieDescription[$i]' border='0'></a>$SmilieLinebreak[$i] ");\n~;
		$more_smilie_array .= qq~"$SmilieCode[$i]", ~;
		$i++;
	}
	opendir(DIR, "$smiliesdir");
		@contents = readdir(DIR);
	closedir(DIR);
	foreach $line (sort {uc($a) cmp uc($b)} @contents){
		($name, $extension) = split (/\./, $line);
		if ($extension =~ /gif/i || $extension =~ /jpg/i || $extension =~ /jpeg/i || $extension =~ /png/i ){
			if ($line !~ /banner/i) {
				$moresmilieslist .= qq~	     document.write("<img src='$smiliesdir/$line' align='bottom' alt='$name' border='0' onclick='javascript:MoreSmilies($i)'>$SmilieLinebreak[$i] ");\n~;
				$more_smilie_array .= qq~" [smiley=$line]", ~;
				$i++
			}
		}
	}
	$more_smilie_array .= qq~""~;

	$yymain .= qq~
	moresmiliecode = new Array($more_smilie_array)

	function MoreSmilies(i) {
		AddTxt=moresmiliecode[i];
		AddText(AddTxt);
	}
 

  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Shoeb Omar
God Member
*****
Offline


Mod Writer

Posts: 5665
Location: San Diego
Joined: Jun 29th, 2001
Gender: Male
Re: Javascript Help
Reply #6 - Apr 14th, 2002 at 1:33am
Print Post  
almost perfect buti have things optional.. wait i think i might be able to fix that up... Smiley thanks! Smiley
  

YaBB SP2 BETA!
Now taking pay jobs in PHP or Perl.  Contact me for details.
Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: Javascript Help
Reply #7 - Apr 14th, 2002 at 1:40am
Print Post  
Well obviously, but I don't know what variables/checks you are using!

Just add the if() {...} statements around the two sections of code that load the arrays (the while (SmilieURL[$i]) {...} add-more-smilies and the opendir...foreach {...} auto-smilies)
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Shoeb Omar
God Member
*****
Offline


Mod Writer

Posts: 5665
Location: San Diego
Joined: Jun 29th, 2001
Gender: Male
Re: Javascript Help
Reply #8 - Apr 14th, 2002 at 1:42am
Print Post  
done lol.... but somehow the code is screwed... it came up with "wacko is undefined" error wheni tried the wacko smiley but then i madly clicked around and after a million clicks dsome code went in  Embarrassed  Undecided
ne ideas?
  

YaBB SP2 BETA!
Now taking pay jobs in PHP or Perl.  Contact me for details.
Back to top
IP Logged
 
Shoeb Omar
God Member
*****
Offline


Mod Writer

Posts: 5665
Location: San Diego
Joined: Jun 29th, 2001
Gender: Male
Re: Javascript Help
Reply #9 - Apr 14th, 2002 at 1:48am
Print Post  
fixed! Smiley (i was clicking my old code Roll Eyes)
  

YaBB SP2 BETA!
Now taking pay jobs in PHP or Perl.  Contact me for details.
Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: Javascript Help
Reply #10 - Apr 14th, 2002 at 1:52am
Print Post  
Wacko undefined? what do you expect this early in the morning! (2:50am for those that don't know)
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint