Log in

View Full Version : Question/Help needed :-D



Dakon Barton
04-13-2006, 06:00 AM
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

djr33
04-13-2006, 06:37 AM
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 :)

Dakon Barton
04-13-2006, 07:23 AM
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
<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)

djr33
04-13-2006, 07:36 AM
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.

Dakon Barton
04-13-2006, 07:37 AM
Suppose you guys would need the code i intend to use it on to suggest how to adapt it huh

$query= mysql_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 (http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip.htm)

djr33
04-13-2006, 07:47 AM
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.


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 :)

Dakon Barton
04-13-2006, 07:59 AM
Ah nvm yes that does work :-D i included it on the php file :-D soo should work now :) thanks

djr33
04-13-2006, 09:07 AM
Sure. Maybe you just missed escaping a quote before or something.

Glad to help!

Dakon Barton
04-13-2006, 09:24 AM
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

Dakon Barton
04-14-2006, 03:32 AM
ok been racking my brain on this all day and i cant understand the error im getting
//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

Dakon Barton
04-14-2006, 04:52 AM
nvm got it

djr33
04-14-2006, 05:56 AM
Cool.
I'm just getting into MySQL syntax... care to enlighten us as to what it was?
Just wondering... looked ok to me... not used to seeing it without the ``` backticks around the things in the code, but that seems to work...

Dakon Barton
04-14-2006, 07:25 AM
Well i to fix it i simply change the query to this

$query= mysql_query("SELECT ibf_members.id,name,mgroup,xfire_id,msnname,email FROM ibf_members LEFT JOIN ibf_member_extra ON ibf_members.id = ibf_member_extra.id WHERE ibf_members.mgroup = 4");


and


while($out = mysql_fetch_array($query))
{
echo "<a href=\"http://www.eternalbrethren.com/forum/index.php?showuser=$out[id]\" onMouseover=\"ddrivetip('MSN:$out[msnname]<br>X-Fire:$out[xfire_id]<br>Email:$out[email]','#001018', 300)\";
onMouseout=\"hideddrivetip()\">$out[name]</a><br>";}


but my next delima is to get it looking like
http://www.eternalbrethren.com/pics/other/picture%20tooltip.jpg that

djr33
04-14-2006, 09:35 AM
ha, fun. well... good luck :)

Then again, once you start doing all this stuff... design is easy, right? ^_^

Dakon Barton
04-15-2006, 06:21 AM
Yea but im not sure if the popup script will support 2 collums and how to display the avatar the pm box and online/offline indicators(namely where they are)

djr33
04-15-2006, 08:44 AM
just worried about layout in the popup? isn't that just a regular html page? I mean... the popup comes up, but it's just showing something.com/something.htm, right?

Dakon Barton
04-15-2006, 09:42 AM
Yea it is, however the mouseover part is included in the php which is fed into the html via SSI Includes, thus i dont think the mouseover will handle the column for that layout

djr33
04-15-2006, 10:14 AM
Sorry... totally missed that.

Mouseover makes the popup happen? Or?

Dakon Barton
04-16-2006, 01:50 AM
ummm leme see here
The Page im using it on (http://www.eternalbrethren.com/members.html)

i need the mouseover script mentioned in i think the first post if not then the third, to match that image lol

djr33
04-16-2006, 04:34 AM
The JS is too complex for me to figure out... but seems like it can't be incredibly hard... but... yeah.

Honestly, now that I see it in action, I'd like to caution you that it's a really bad idea. When I see an email address or msn IM SN, I like to copy and paste it so I can email/IM them. I'm very much not gonna retype the whole thing unless it's really important, and it probably isn't.
You should figure out a way that makes it easier to contact them, not just see a glimpse of their email. :)



Ah! I just checked again, and clicking makes their profile show up.... right. Hmm... ok. That's not so bad then. But... still... above... hmm... weird.
But... alright :) Not as bas as I thought, anyway... just a bit confusing for people who don't trying clicking when they can't select from the tooltip...

Dakon Barton
04-16-2006, 10:33 AM
Yea it aint too bad the page itself will eventualy have no right click and no select so that'll be fun, as for the whole privacy thing *points to join app for that guild* nother project in the works, but it will have disclaimer as to if they want that info shown, yea js gives me a headache too, but i try to do as they wish on the page, any ideas on how to get that mouseover into 2 column's ?

djr33
04-17-2006, 04:42 AM
Just put two column html in place of what's shown now, but I didn't see where that was and JS generally confuses me.

About no right click... read the other threads about this. You can't stop spammers, and you'll just annoy the innocent people.

The random guy who wants to contact someone will not be able to, but the spammers will get around your petty security measures, and you'll be 0 for 2.

You need to either let people have the emails or not let anyone have them (don't show them), or it'll just cause problems. Really.. it will.

Dakon Barton
04-17-2006, 05:39 AM
Well see the person wanting this wants that image put on the mouseover script i.e when they mouse over the name show that. As for the right click oh i know it doesnt do jack for protection, but who said i wasnt doing it TOO annoy the innocent people LOL (sorry one of them moods), probably right LOL im gona make it their choice as it is now, if they fill out the information in their user cp then itll show otherwise it wont plain and simple, but any ideas on how to edit that mouseover script to allow column display instead of text, i got to thinkin of doing the DIV command for it but that gets to be a pain when the div wont display the variables i want it too, i did get a mean lookin calculator when i attempted it thou, so not all bad LMFAO

djr33
04-17-2006, 05:45 AM
ha, alright. Well... still, no real clue with the JS. This is still in the php forum. wait a bit, then maybe mention it over there if no one sees this.