Maian Script World on Facebook Maian Script World on Twitter Maian Script World - Latest News Maian Script World on YouTube Maian Script World on LinkedIn


Please Read

You are required to register before you can post. This is via a custom verification system. Please post any problems you are encountering here and I`ll do my best to respond as soon as I can. Please note that a reply WILL be posted to all queries, so do not double post. There are no guarantees when a reply will appear but I do my best to answer all within 3/4 days max. Bumping topics won`t make the slightest difference.

IMPORTANT: Posts in English ONLY please, thank you! Any other languages will be ignored and your message deleted.
SEARCH: Use the search option to see if your question has been answered on the forum before. Or check the relevant script docs.
CUSTOMER: If you have purchased a commercial version of any of my software, using the contact option at the licence centre ensures a faster response.
AUTO DELETION: Accounts older than 5 days, with no posts or topics, are automatically deleted. Only register if you are thinking of posting.
PRIVATE MESSAGES: Private messages are currently disabled.
LINKS: Any links posted are 'NOFOLLOW' and will not be picked up by search engines.

You are not logged in.

#1 06-04-2011 09:46:53

duceduc
Members
From: Japan
Registered: 25-05-2010
Posts: 359

adding 'website' field to comment box and displaying it

I wish to add a 'website' field box to the comment box area for visitors who wish to input their websites. After which, I want their website to be a link to their name.

I have successfully added the field to the comment box and added a column labeled 'website' in the mw_comments table. The website entry is save to the database.

My problem is coming up with a code to have it either show just their names or their names embedded with their website link in the comment box.

Offline

#2 07-04-2011 05:28:53

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,074

Re: adding 'website' field to comment box and displaying it

Open the language file. Find:

$msg_viewblog              = 'Posted by <b>{poster}</b> on {date}';

Add another similar line with a url:

$msg_viewblog9              = 'Posted by <a href="{url}"><b>{poster}</b></a> on {date}';

Open the main index file. On line 450 find:

$find       = array('{comment_class}','{post_content}','{post_date}','{path}');

Above that add:

$lang = ($COMMENTS->website ? str_replace('{url}',$COMMENTS->website,$msg_viewblog9) : $msg_viewblog);

On line 452, change:

$msg_viewblog

to

$lang

Should be ok.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#3 07-04-2011 08:30:59

duceduc
Members
From: Japan
Registered: 25-05-2010
Posts: 359

Re: adding 'website' field to comment box and displaying it

Haha. I had the first part right, but in the main file, I couldn't get the code right on my stab at it. Thanks.

Offline

#4 09-04-2011 05:40:18

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,074

Re: adding 'website' field to comment box and displaying it

duceduc wrote:

Haha. I had the first part right, but in the main file, I couldn't get the code right on my stab at it. Thanks.

No? What happened? Code error?


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#5 09-04-2011 08:24:35

duceduc
Members
From: Japan
Registered: 25-05-2010
Posts: 359

Re: adding 'website' field to comment box and displaying it

Not exactly. The link would display the home website and not the website the visitor posted.

Offline

#6 09-04-2011 18:03:12

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,074

Re: adding 'website' field to comment box and displaying it

duceduc wrote:

Not exactly. The link would display the home website and not the website the visitor posted.

Did you check the var names were correct? I just used examples.

$COMMENTS->website

That is the visitor url field?


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

Board footer

2Checkout.com is an authorized reseller of goods and services provided by Maian Script World.© 2003-2013 David Ian Bennett. All Rights Reserved | Forum: FluxBB

Privacy Policy | Refund Policy