Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
why it is working twice?
Old 06-11-2010, 03:23 AM why it is working twice?
asmalik12's Avatar
Extreme Talker

Posts: 173
Name: Abdullah Saleem
Trades: 0
Hi,

PHP Code:
 if(!is_page($post_id) && is_single($post_id)){
        
$post get_post($post_id);
        
$author_id $post->post_author;
        
$author_posts_rss_link get_author_feed_link($author_id);
        
$author the_author();
        return 
$content.'<div id="subscribe_to_author_posts_feed"><a href="'.$author_posts_rss_link.'"><img src="'.$path.'http://www.cricpak.5gigs.net/wp-content/themes/wpsn/images/feed.png" width="10" height="11" border="0" alt="RSS" title="RSS" /></a><font size="1" face="Verdana">&nbsp;Feeds : '.$author.'</font></div>;
    }

    return $content;

The above php code is showing '.$author.' twice. If I change the position (take it above others) of $author = the_author();, it shows author name more than twice. Is there any solution to finish it after $author = the_author();.
__________________
"Think 100 times before you take a decision, But once that decision is taken, stand by it as one man." - Quaid-e-Azam
asmalik12 is offline
Reply With Quote
View Public Profile Visit asmalik12's homepage!
 
 
Register now for full access!
Old 06-11-2010, 04:56 AM Re: why it is working twice?
Mad182's Avatar
Skilled Talker

Posts: 54
Name: Madars
Location: Latvia
Trades: 0
Is this from wordpress?
I think the_author(); function is meant to print authors name, not for returning it. You could use get_the_author(); instead.
http://codex.wordpress.org/Template_Tags/the_author
__________________
There's no place like 127.0.0.1

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Mad182 is offline
Reply With Quote
View Public Profile Visit Mad182's homepage!
 
Old 06-11-2010, 09:08 AM Re: why it is working twice?
asmalik12's Avatar
Extreme Talker

Posts: 173
Name: Abdullah Saleem
Trades: 0
yeah, it is wordpress. thank u very much.
__________________
"Think 100 times before you take a decision, But once that decision is taken, stand by it as one man." - Quaid-e-Azam

Last edited by asmalik12; 06-11-2010 at 09:11 AM..
asmalik12 is offline
Reply With Quote
View Public Profile Visit asmalik12's homepage!
 
Old 06-15-2010, 05:42 PM Re: why it is working twice?
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
As a side note, to get a form to stop entering data once the Submit button is pressed, (if that's what you want), you can use this javascript:

Code:
<input type="submit" value="Submit" onclick="javascript: this.disabled='true';" />
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to why it is working twice?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32529 seconds with 12 queries