sNews Forum

sNews 1.6 (previous version) => Programming => Topic started by: Sven on June 27, 2008, 05:19:29 pm

Title: How can I write $dmeta to have the category meta description
Post by: Sven on June 27, 2008, 05:19:29 pm
Hello pals,
Google isn't pleased with this tiny piece of code coming from this thread (http://snewscms.com/forum/index.php?topic=7295.msg51603#msg51603):
Quote
[    if (!empty($categoryName)) {  //<-- new addition, like NaEnr mod...
      $title = $categoryName;
      $dmeta='All articles under '.$title.' category';
      $kmeta=$title;     
   }
It seems Google would prefer to have the meta description I have in the DB for each category.
What should I put there to display its content:
Quote
$dmeta=...
???

Trying, $dmeta = $r['description_meta'];
returns Website description  ::)
Title: Re: How can I write $dmeta to have the category meta description
Post by: funlw65 on July 02, 2008, 12:19:14 pm
Mr. Sven,
An idea:
If you stay on a defined number of categories, then make an array with descriptions and display them accordingly (depending on category name). Look at db array for example and how you retrieve values from that.

-----------------------------------
Solved with query but I like also the above idea...