Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Question/Help needed :-D

  1. #1
    Join Date
    Apr 2006
    Location
    Waco,Tx
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Question/Help needed :-D

    Well i saw the DHTML tooltip script on this site and im wanting to use that, however the downside being the page im wanting to use it on is in php/html(via a ssi include on the html). Is there any way to add this script or convert it to php?

    Any help ya'll can provide would be greatly appreciated

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    This probably isn't going to help you much, and I'm not sure how that script works, but just for your information:
    PHP isn't special. It's just a coding language you can use to add to your page... what it outputs is pure html.

    In other words, you could just rename a .htm page ".php" and it would change nothing.
    the only difference is what the php does... you can control the html each time the page loads or whatever.

    so... basically... the php shouldn't affect the script at all... assuming it doesn't change the page so much each time that it somehow changes where/how/what it would do, etc.


    But, you may know this already... just a heads up in case.

    Have you tried it already? Did it not work? If it didn't, then you can probably ignore this post If not, give it a try. The worst that can happen is it won't work... and it might, so that would be good

  3. #3
    Join Date
    Apr 2006
    Location
    Waco,Tx
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yea i attempted it already, my theroy is due to the fact DHTML uses ; and a few other components that php also uses, its getting confused on how to handle it. However ive also tried useing the ssi include on the html then tossing the javascript and dhtml bits into that then only tossing the
    Code:
    <a href="http://yahoo.com" onMouseover="ddrivetip('Yahoo\'s Site', 'yellow', 250)";
     onMouseout="hideddrivetip()">Yahoo</a>
    into the php where needed, problem with that was the fact that doing it that way it would referance the ddrivetip and the hideddrivetip to the php not the html thus it didnt work >.< (and i didnt know bout that whole just tossing a different extention on the html documents, last i tried it it didnt like something on my page so i figured it didnt work that way)

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Easy thing first... what I meant by "tossing different extensions on html documents" is that a .php page with no <?php ... ?> code blocks is just a pure html page (or, I suppose, xml or whatever you're using... I think, anyway... not positive abou that.) I just meant, basically, that the php format is nothing special. The php will be the first thing evaluated, then sent to the browser as pure html, along with the javascript. Only after that will the browser start doing stuff with the js... meaning that the php shouldn't be affecting it too much.

    Are you sure your php is right? You are trying to use "echo" or something to output a line of text that has both single and double quotes... only possible using either escaping methods (1), multiple bits (2), or a chunk syntax thing... can't remember the name of that, exactly (3).
    Examples of above:
    1) echo "<a href=\"blah\'blah\'blah\">something</a>";
    Note the use of slashes before the quotes. This makes php ignore them and output the quote after them only, not the slash. It's called "escaping", and comes in handy. Looks like you already did that, but just for the js, with the "Yahoo\'s" thing.
    2) echo "<a href=".'"blah'."'blah'blah".'">something</a>;
    This one seperates the quotes into bits... so you use single quotes to echo doubles, and doubles to echo singles. It can get annoying and messy, though.

    3) This one is the most complex, but nice for long blocks of text:
    Ex:
    echo <<<varname
    <a href="blah'blah'blah">something</a>
    varname;
    The last line must be "[varname];" with no extra whitespace, and nothing after. Weird rule. The first must look like above, with echo <<<[varname].
    Then, inside that chunk, ALL characters will work... single quotes, doubles, etc.


    Hope this is the problem, 'cause it's easy. Not sure about the rest of that... hope I'm pointing you in the right direction.

  5. #5
    Join Date
    Apr 2006
    Location
    Waco,Tx
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Suppose you guys would need the code i intend to use it on to suggest how to adapt it huh
    PHP Code:
    $querymysql_query("SELECT id,name,mgroup FROM ibf_members Where mgroup =4");

    while(
    $out mysql_fetch_array($query))
    {
    echo 
    "<a href=\"http://www.eternalbrethren.com/forum/index.php?showuser=$out[id]\">$out[name]</a><br>";

    Thats the first lil part (the other 2 query's are below that but thats just to get an idea of what im wanting to use it on)

    the DHTML i wish to use with it

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    K. So you are escaping quotes. Good. Nevermind about above then.

    Ha, invision board. I use it too... might be able to help a bit more, knowing that.


    What you posted works just fine, right? Shouldn't be looking for errors in that?


    So... let's see....

    I'm gonna simplify it down to just your echo line... no need for the rest.

    PHP Code:
    echo "<a href=\"http://www.eternalbrethren.com/forum/index.php?showuser=$out[id]\" onMouseover=\"ddrivetip('JavaScriptKit.com JavaScript tutorials','yellow', 300)\";
    onMouseout=\"hideddrivetip()\">
    $out[name]</a><br>"
    Just added it in there, and escaped the quotes.

    Does that work? Have you tried it like that already?

    If not, I'll need more info and might not be able to help... just getting into some of this myself... but I'm sure someone will have an answer if I don't

  7. #7
    Join Date
    Apr 2006
    Location
    Waco,Tx
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah nvm yes that does work :-D i included it on the php file :-D soo should work now thanks

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Sure. Maybe you just missed escaping a quote before or something.

    Glad to help!

  9. #9
    Join Date
    Apr 2006
    Location
    Waco,Tx
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    lol probably issed somethin easy, now comes the fun task of trying to get information pulled from ibf_member_extra (i.e xfire and msn info) tried it a bit ago and since the 2 have the id field in common it didnt work lol but im gona try again later today :-D

  10. #10
    Join Date
    Apr 2006
    Location
    Waco,Tx
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok been racking my brain on this all day and i cant understand the error im getting
    Code:
    //Alright lets get our Members
    $query= mysql_query("SELECT id,name,mgroup,xfire_id,msnname FROM ibf_member_extra LEFT JOIN ibf_members ON ibf_member_extra.id = ibf_members.id WHERE mgroup = 4");
    $result = mysql_query("SELECT id,name,mgroup FROM ibf_members Where mgroup =7");
    $dos = mysql_query("SELECT id,name,mgroup FROM ibf_members Where mgroup =6");
    
    //ok first group to display
    echo "<h3><i><b>Lord/Lady</b></i></h3>";
    while($out = mysql_fetch_array($query))\\this being line 116
    {
    echo "<a href=\"http://www.eternalbrethren.com/forum/index.php?showuser=$out[id]\" onMouseover=\"ddrivetip('$out[xfire_id]','yellow', 300)\"; 
    onMouseout=\"hideddrivetip()\">$out[name]</a><br>";
    }
    error i get is
    Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/eternal/public_html/memberlist2.php on line 116

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •