The vB Geek

Go Back   The vB Geek > vB Geek Products > Geek Article and Review System

Geek Article and Review System GARS is the mega popular system for turning forums into articles, tutorials, or even reviews.

Advertisement
  Learn how to remove ads

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2007, 05:43 AM
James Goddard's Avatar
James Goddard James Goddard is offline
Junior Member
 
Join Date: Oct 2005
Posts: 26
Geek Article and Review System License Holder Geek Advertising Banner License Holder 
Default A little help Geek...

Ok, I'm doing something a little different here.

I'm using GARS to handle news and articles for my site, however, I don't want the news and articles to look like they are part of my forums. I could have used a non-VB integrated product to do what I want but, well I'm already familiar with GARS and I think it's a great product.

So here is what I have done. I have setup separate news and article trees on my site and replaced forumdisplay,showthread,etc with custom versions. These act specifically on hidden forums that are GARS enabled.

Everything works great except for one thing...searching. I've set up special news search and article search forms that do what they should using the forum choices but a general search and a newpost search still turn up these items. I don't have a problem with this except that they display VB links rather than my custom links which doesn't display them the way I want.

I can plug in some code to exclude these forums from those searches but what I'd really like to do is dynamically hook into the search results and move the user to the right place.

I can go modify search.php to do what I want but it occurs to me that you are already doing what I need to do and I could more easly piggyback off your code.

What I want to do is hook into your showthread hook. You already figure out if the forum is a "news", "article", "review", aka "GARS type" forum and do your thing. I just want to change that to rather than do your thing, do a 301 redirect from /forums/showthread.php to /news/readnews.php, etc.

Can you point me in the right direction to where you are doing this?

James

P.S. As soon as I figure out where you are doing it I'll probably be asking for a hook there .
Reply With Quote
  #2  
Old 03-01-2007, 09:29 AM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

Wouldnt a template edit be the easiest?

In other words: edit the threadbit search uses to display results and wrap a conditional around the url. I can also put in a hook for the gars_ignition file (the file that determines if gars should be run or not) for 2.1.5
Reply With Quote
  #3  
Old 03-03-2007, 03:58 AM
James Goddard's Avatar
James Goddard James Goddard is offline
Junior Member
 
Join Date: Oct 2005
Posts: 26
Geek Article and Review System License Holder Geek Advertising Banner License Holder 
Default

Quote:
Originally Posted by The Geek View Post
Wouldnt a template edit be the easiest?

In other words: edit the threadbit search uses to display results and wrap a conditional around the url. I can also put in a hook for the gars_ignition file (the file that determines if gars should be run or not) for 2.1.5
I'm not sure how a template edit would have helped, I guess I could have compared the thread forumid over and over against all the news forums...

Anyway I actually wound up doing this with a hook in showthread_getinfo. If anyone else is looking to do this this is my code:

PHP Code:
   global $threadid$thread;
   require_once( 
'includes/functions_misc.php');
   
$nfs fetch_child_forums3'ARRAY');
   if (
in_array$thread['forumid'], $nfs))
   {
      
Header"HTTP/1.1 301 Moved Permanently" );
      
Header"Location: http://www.scubaguide.org/news/readnews.php?t=$threadid" );
      exit;
   }
   
$afs fetch_child_forums8'ARRAY');
   if (
in_array$thread['forumid'], $afs))
   {
      
Header"HTTP/1.1 301 Moved Permanently" );
      
Header"Location: http://www.scubaguide.org/articles/readarticle.php?t=$threadid" );
      exit;
   } 
So I basicly bypassed gars. I had been thinking I could put a similar hook somewhere in GARS that instead of look for children of the "news" or "article" forums, looked for "news" type or "article" type. This works just as well, but is a little slower. Not slow enough to worry about though.

This works ideally for me. If a user does a new post search they see any new news or article items, but when they click on them they get redirected to the custom display.

I now think I have all the "issues" worked out. If you want to see a GARS implementation that doesn't look like it's part of the forums, check out:

http://www.scubaguide.org/news/
http://www.scubaguide.org/articles/

James

Last edited by James Goddard; 03-03-2007 at 04:05 AM..
Reply With Quote
  #4  
Old 03-04-2007, 01:17 PM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

great news James. THanks
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thanks Geek Bree Geek Auto-Linker 1 05-30-2007 09:12 AM
Geek need your help venon Geek Advertising Banner System 11 03-15-2007 09:00 AM
Geek gone? The Geek Lizard Lounge 7 06-15-2006 01:57 PM
Where is The Geek? tylercruz Geek Auto-Linker 7 06-14-2006 08:27 AM
/geek/gars/images VS /geek/gars/images/types Stachel Geek Article and Review System 21 01-25-2006 05:36 AM


All times are GMT. The time now is 05:11 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.