View Full Version : search engine modifications
thomas
08-10-2005, 06:54 AM
hey all.
i need some help modifying the search engine a bit (not the google one) the one that searchs the news articles plugin number 23.
Anyhow. I want to show the category name and also the date the article was created in the results.
Currently only the title returns.
Can someone help with this.
ta
thomas
08-12-2005, 06:36 AM
Originally posted by thomas@Aug 10 2005, 05:54 PM
hey all.
i need some help modifying the search engine a bit (not the google one) the one that searchs the news articles plugin number 23.
Anyhow. I want to show the category name and also the date the article was created in the results.
Currently only the title returns.
Can someone help with this.
ta
466
Specifically I need to work out the code that returns the Category name (I have worked out how to pull the date in)
So dose anyone know the SQL select statement that i will need to match the category name to the news articles, it will have to be some join statement from both the tables??
PLEASE?
abcohen
08-12-2005, 01:57 PM
that plugin isnt free for light user -- I'm sorry
Originally posted by abcohen@Aug 12 2005, 06:57 AM
that plugin isnt free for light user -- I'm sorry
523
That's okay, he's a pro member and showing the code changes won't give away anything to light members. :)
thomas, I just have a couple questions for you:
1) How would you like the columns ordered?
New Title - Date - Category Name
Does that sound okay?
2) Would you like the category name link to the actual category?
thomas
08-24-2005, 12:06 AM
Originally posted by subduck@Aug 24 2005, 10:56 AM
That's okay, he's a pro member and showing the code changes won't give away anything to light members. :)
thomas, I just have a couple questions for you:
1) How would you like the columns ordered?
New Title - Date - Category Name
Does that sound okay?
2) Would you like the category name link to the actual category?
818
News title(linked to the actual news article - already done)
News Category: [News Category](to the category the news article resides in)
Date: [Date]
Originally posted by thomas@Aug 23 2005, 05:06 PM
News title(linked to the actual news article - already done)
News Category: [News Category](to the category the news article resides in)
Date: [Date]
819
Ok that won't be a problem, just give me a few more minutes :)
Open up subdreamer/plugins/p23_search_engine/search_engine.php
Find this code on line 26:
$getarticles = $DB->query("SELECT categoryid, articleid, title FROM " . TABLE_PREFIX . "p2_news
Change it to this:
$getarticles = $DB->query("SELECT categoryid, articleid, datecreated, title FROM " . TABLE_PREFIX . "p2_news
Find this code on line 38:
* *echo '<tr>
* * * * * *<td style="padding-bottom: 7px;" valign="top"><b>Title</b></td>
* * * * *</tr>';
Change it to this:
* *echo '<tr>
* * * * * *<td style="padding-bottom: 7px; padding-right: 7px;" valign="top"><b>News Title</b></td>
* * * * * *<td style="padding-bottom: 7px; padding-right: 7px;" valign="top"><b>News Category</b></td>
* * * * * *<td style="padding-bottom: 7px; padding-right: 7px;" valign="top"><b>Date</b></td>
* * * * *</tr>';
Find this code on line 64:
echo '<td style="padding-bottom: 7px;" valign="top"><a href="' . RewriteLink('index.php?categoryid=' . $article['categoryid'] . '&p2_articleid=' . $article['articleid']) . '">' . $article['title'] . '</a></td>';
Change it to this:
echo '<td style="padding-bottom: 7px; padding-right: 7px;" valign="top"><a href="' . RewriteLink('index.php?categoryid=' . $article['categoryid'] . '&p2_articleid=' . $article['articleid']) . '">' . $article['title'] . '</a></td>
* * *<td style="padding-bottom: 7px; padding-right: 7px;" valign="top"><a href="' . RewriteLink('index.php?categoryid=' . $article['categoryid']) . '">' . $categoryexists['name'] . '</a></td>
* * *<td style="padding-bottom: 7px; padding-right: 7px;" valign="top">' . DisplayDate($article['datecreated']) . '</a></td>';
That should do it!
thomas
08-24-2005, 12:56 AM
Sweet.
Thank subduck.
I nearly had it all....just those rewrites put me off.
All is good now
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.