Current location: Hot Scripts Forums » Programming Languages » PHP » Dynamic link tags?


Dynamic link tags?

Reply
  #1 (permalink)  
Old 08-20-05, 09:15 PM
Blaine0002 Blaine0002 is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Dynamic link tags?

Hi, im going to make a new Magic: The gathering website, but first i need a little help. I want to be able to put [card] tags in my webpage surrounding card names, and i want people to be able to click on them and go to here.

http://gatherer.wizards.com/?first=1&last=100&term={{{CARDNAMEHERE}}}&Field_Na me=on&Field_Rules=on&Field_Type=on&setfilter=Allse ts&colorfilter=All&typefilter=All&output=summary&s ort=name&x=0&y=0

so whatever was in the card tags gets put in the {{{CARDNAMEHERE}}}
replacing spaces with +'s.

how would i go about doing this?
(im kind of a newbie at php, so dont flame me )
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-20-05, 11:58 PM
Blaine0002 Blaine0002 is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
i looked into it a bit more and found something called e-tags that does somthing like this,
http://www.essentialmagic.com/Miscellaneous/eTags.asp
Im not sure if the "e-tag" part is an actual script or somthing the website made up, because i cant find any referances to it other places on the net.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-21-05, 11:05 AM
Blaine0002 Blaine0002 is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
i found somthing out, i could use

PHP Code:

<?php

  
function bbc2html($data) {
    
$data=str_replace("[card]","<a href="http://gatherer.wizards.com/?first=1&last=100&term=",$data);
    
$data=str_replace("[/card]","&Field_Name=on&Field_Rules=on&Field_Type=on&setfilter=Allsets&colorfilter=All&typefilter=All&output=summary&sort=name&x=0&y=0"></a>",$data);
    return 
$data;
  }
?>
that would create the link tags around the card name, but how would i make it so it would still show the card name on the page?

EDIT: also how would i go about replacing the spaces with +'s?

Last edited by Blaine0002; 08-21-05 at 11:09 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-21-05, 12:14 PM
Blaine0002 Blaine0002 is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
man, fix the edit button......

Anyways, my friend came up with this code...
PHP Code:

 $sIn ereg_replace('\[card\](.*)\[\/card\]''<a href="http://gatherer.wizards.com/?first=1&last=100&term=\\1&Field_Name=on&Field_Rules=on&Field_Type=on&setfilter=Allsets&colorfilter=All&typefilter=All&output=summary&sort=name&x=0&y=0/">\\1</a>'$sIn); 

but he says
Quote:
it's grabbing the very last [/card] instead of the following next one
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Xml / Dom / Css Mark_SC.SE JavaScript 0 06-29-05 09:05 AM
I'm confused..plz help Brittany23 CSS 5 05-24-05 12:52 PM
How can I strip certain tags between certan points? Keith PHP 10 03-25-05 10:59 AM
2 flash websites for sale metamorph General Advertisements 5 01-09-05 11:03 PM
Passing a table or variable through a link? chinablack1480 PHP 1 12-07-03 04:55 AM


All times are GMT -5. The time now is 09:58 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.