ArticleTrader.com
  

 Main Menu

  Home
  Member Login
  Forum
  Submit Article
  RSS Feeds
  Contact Us
  About

 Services

  Article Distribution
  Link Building

 Tools

  ArticleMS
  Directory Tracker

 Categories

  Automotive
  Business
  Computers
  Entertainment
  Finance
  Food
  Health
  Home and Family
  Internet
  Legal
  Science
  Self Improvement
  Shopping
  Society
  Sports
  Technology
  Travel
  Writing





























 
Welcome! ( Login | Register )
» ArticleTrader Forums » ArticleMS » Support » preg_replace ??
Members Search Help

Pages: << prev 1 next >>
preg_replace ??
This member is currently offline yaniv
Newbie


Member Level

Group: Members
Posts: 11
Joined: Today

Go to the bottom of the page Go to the top of the page

Hello,

I'm using the topauthors Block on my homepage and I'd like to remove <a href> links from the bio text...
I know it can be done using "preg_replace", but I don't know how to implement it.
Anyone know how to do that?

Thanks,
Yaniv


Posted Jul 17, 2009, 2:11 pm
This member is currently offline Anne Kirrin
Pool


Avatar

Member Level

Group: Moderators
Posts: 1,356
Joined: Apr 11, 2006

Go to the bottom of the page Go to the top of the page

Use this in the php section of block:

PHP:

$whatever_var_for_author_bio_is str_replace('</a>'''$whatever_var_for_author_bio_is); 
$whatever_var_for_author_bio_is preg_replace('/(<a[\s]+[^>]+)>/i'''$whatever_var_for_author_bio_is);



Or this will add rel="nofollow" to the link instead:
PHP:

$whatever_var_for_author_bio_is preg_replace('/(<a[\s]+[^>]+)>/i''\\1 rel="nofollow">'$whatever_var_for_author_bio_is);

.........................
Anne Kirrin is in Nepal for the month of November

ArticleMSSkins.net <<:::: New
Directory of Niche Article Sites <::::: Add your article site for free!!

Posted Jul 17, 2009, 8:00 pm
This member is currently offline yaniv
Newbie


Member Level

Group: Members
Posts: 11
Joined: Today

Go to the bottom of the page Go to the top of the page

So the PHP part of the topauthors block should be something like that?

PHP:
$this->authors $this->getUsers('''user_article_count DESC'5);
$this->authors->bio str_replace('</a>'''$this->authors->bio); 
$this->authors->bio preg_replace('/(<a[\s]+[^>]+)>/i'''$this->authors->bio);


It's not working...

Posted Jul 18, 2009, 6:15 pm
This member is currently offline Anne Kirrin
Pool


Avatar

Member Level

Group: Moderators
Posts: 1,356
Joined: Apr 11, 2006

Go to the bottom of the page Go to the top of the page

try $this->authors[$this->i]->bio
.........................
Anne Kirrin is in Nepal for the month of November

ArticleMSSkins.net <<:::: New
Directory of Niche Article Sites <::::: Add your article site for free!!

Posted Jul 19, 2009, 3:28 am
This member is currently offline yaniv
Newbie


Member Level

Group: Members
Posts: 11
Joined: Today

Go to the bottom of the page Go to the top of the page

It's not doing anything...

Posted Jul 19, 2009, 5:10 am
This member is currently offline yaniv
Newbie


Member Level

Group: Members
Posts: 11
Joined: Today

Go to the bottom of the page Go to the top of the page

Any other ideas?

Posted Jul 21, 2009, 5:10 am
Pages:<< prev 1 next >>

Dec 2, 2009, 3:58 am

  

0.0157s