WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

How could I implement this?
Custom link formatting

Version:
printPrint


How could I implement this?
Thermit
Member

Usergroup: Customer
Joined: Oct 25, 2004
Total Topics: 8
Total Posts: 28
Posted 11/09/04 - 07:18 PM:
quote post
#1
I have an extra link field called "anchor", which contains a string.

I'd like to be able to display the link description such that if the contents of the link anchor appears in the link description, the description is tweaked to format the matching anchor substring as an HTML link. Plus, I also want to be able to get the description in regular and link-ified forms in the templates.

For example:

Description: "WSN Links is powerful directory software."
Anchor: "directory software."

{$LINKDESCRIPTIONHTTP} would display...

WSN Links is powerful directory software.


I looked thru code but didn't obviously locate the right place to add something like this. Also the use of a custom field seemed to make the issue more complex. Would really appreciate some ideas on this...

Thanks.
fresco
Forum Regular

Usergroup: Customer
Joined: Feb 19, 2003
Total Topics: 22
Total Posts: 101
Posted 11/09/04 - 07:34 PM:
quote post
#2
check http://truefresco.org/link_directory/index.php?ac...

you will se a "geo box"

the country/state/city fields are clickable and searchable will return all links that have same country if you click on country name.

is that what you are looking for?

I still need to limit the results to the original link category but at present time there is not enough sites that have geobox configured (was implemented last month).

Edited by fresco on 11/09/04 - 07:38 PM. Reason: error
Thermit
Member

Usergroup: Customer
Joined: Oct 25, 2004
Total Topics: 8
Total Posts: 28
Posted 11/09/04 - 07:39 PM:
quote post
#3
Thanks fresco, that's a nice site you've got there, but I need to make part of the description linkable using the URL and a custom field with the string to link-up.
fresco
Forum Regular

Usergroup: Customer
Joined: Feb 19, 2003
Total Topics: 22
Total Posts: 101
Posted 11/09/04 - 08:22 PM:
quote post
#4
just put whatever you need into the description (into template) right outside of {LINKDESCRIPTION} (i created geobox).

or you want to make something like infamous browser addons "hot links" - a wile ago i am not sure what they were called - it will search the text on the page you view and auto hotlink it to serches/products...

check this link http://eliot.landrum.cx/archives/category/mt-refsearch/
Thermit
Member

Usergroup: Customer
Joined: Oct 25, 2004
Total Topics: 8
Total Posts: 28
Posted 11/13/04 - 06:53 PM:
quote post
#5
Yeah, it's kinda like the hot links.

I'm hoping Paul could shed some light on how the code could be modified to add the new template tag containing the description with an embedded hyperlink...

Entry description: "WSN Links is powerful directory software."
Entry custom field "Anchor": "directory software"

And code in the appropriate PHP script such that {$LINKDESCRIPTIONHTTP} would display...

WSN Links is powerful directory software.
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5965
Posted 11/13/04 - 10:44 PM:
quote post
#6
Possible, I suppose, by changing the description function in classes/onelink.php. Inside that function you'd need to change function description($length = 0) to function description($length = 0, $anchor = 0) and else $descrip = $this->description;

return $descrip; to else
{
$descrip = $this->description;
if ($anchor) $descrip = str_replace($this->anchor, 'id .'">'. $this->anchor .'', $descrip);
}

return $descrip;

Would then be used with {LINKDESCRIPTION[0 1]}

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.