View Full Version : Adding a link back to an adoptable's stats
Hwona
07-16-2013, 08:26 AM
Hello, I was thinking about adding a link back to an adoptable's stats from the "click" page, but I can't figure out how to insert the adoptable's id into the "stat" page url. Can someone help me? :)
Infernette
07-16-2013, 11:01 AM
{$this->adopt->aid} is what you need. ^^
Hwona
07-16-2013, 11:40 AM
Thanks! So I just plug this thing into the link? >^.^<
Infernette
07-16-2013, 11:44 AM
Yep! If you want to get anything else on the adopt, replacing aid also works. If you get an error about it being a private thing, tell me and what file you're editing so I can tell you how to remove that (so you don't have to add a column, or you can add one).
>Slow coding day today, all I need to do is fix up the profile page to my likes and add in a slot buying page, which the slots thing is done.<
Hwona
07-16-2013, 12:01 PM
Doesn't work - probably because I'm editing the lang levelup file but, is this how it's suppossed to be done?:
<a href="http://caterpillarcave.x10.mx/levelup/stats/{$this->adopt->aid}" target="_self" title="" style="font-size:16;color:black;font-family:;text-decoration:none;">Click here to view this adoptable</a>
The php is smack in the middle of the link. O.o
Hall of Famer
07-16-2013, 12:05 PM
Well Id say using the GUI component Link object is the better idea, since you never know where the relative url will resolve to.
Hwona
07-16-2013, 12:15 PM
Oh, but what's that? I don't have any experience with PHP, so I'm kind of trying to figure out what that is... >.<
Infernette
07-16-2013, 01:43 PM
Doesn't work - probably because I'm editing the lang levelup file but, is this how it's suppossed to be done?:
<a href="http://caterpillarcave.x10.mx/levelup/stats/{$this->adopt->aid}" target="_self" title="" style="font-size:16;color:black;font-family:;text-decoration:none;">Click here to view this adoptable</a>
The php is smack in the middle of the link. O.o
Yeah, I normally don't go through the lang file. In the php file it'd work, I have done something similar. I don't use the styles either (would you believe me if I told you I spent 2 hours trying to figure out how to align something?) :coloness:
Hwona
07-16-2013, 02:20 PM
Yeah, I normally don't go through the lang file. In the php file it'd work, I have done something similar. I don't use the styles either (would you believe me if I told you I spent 2 hours trying to figure out how to align something?) :coloness:
Well, you have a really amazing site so sorry, but no, I don't believe you. XP
So let me try it in the php file...
Edit: Uh oh - broke the page! :L Erm, what's supposed to go around the link?
I've been trying to put it in like this: $pagelink = <a href="http://caterpillarcave.x10.mx/levelup/stats/{$this->adopt->aid}" target="_self" title="" style="font-size:16;color:black;font-family:;text-decoration:none;">Click here to view this adoptable</a>
$document => addlangvar ($message, $pagelink);
Infernette
07-16-2013, 02:47 PM
Well, you have a really amazing site so sorry, but no, I don't believe you. XP
So let me try it in the php file...
Edit: Uh oh - broke the page! :L Erm, what's supposed to go around the link?
I've been trying to put it in like this: $pagelink = <a href="http://caterpillarcave.x10.mx/levelup/stats/{$this->adopt->aid}" target="_self" title="" style="font-size:16;color:black;font-family:;text-decoration:none;">Click here to view this adoptable</a>
$document => addlangvar ($message, $pagelink);
It needs to be a regular dash not a equals sign, methinks.
Hwona
07-16-2013, 03:07 PM
Ok, doesn't work with dashes either. O.o
This is the closest I've gotten:
$pagelink = <html><a href="http://caterpillarcave.x10.mx/levelup/stats/<?php{$this->adopt->aid}?>" target="_self" title="" style="font-size:16;color:black;font-family:;text-decoration:none;">Click here to view this adoptable</a></html>
Hall of Famer
07-20-2013, 03:40 PM
Well you better use the GUI API rather than embedding PHP code inside HTML. The code you posted above clearly aint working 'cause you are trying to assign a string variable $pagelink, but its not a string.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.