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-2006, 08:23 PM
Marris Marris is offline
Junior Member
 
Join Date: Feb 2006
Posts: 23
Geek Article and Review System License Holder 
Question What changes do I need to make to use a vBAdvanced module in GARS?

I am trying to adapt a vBAdvanced CMPS module for use in a GARS module block, without much luck. I've read through the vBAdvanced.com manual entry on integrating modules on other pages, but that's not exactly what I need.

The modules in question are vBAdvanced modules included with:

Links and Downloads Manager 2.1.3b2

...which also needs to be installed along with the vBAdvanced module.

The specific module I want to include as a GARS module is ldm_hot.php, which displays the most popular links in the Links and Downloads Manager directory.

This is the full code of ldm_hot.php, which is installed and works properly with vBAdvanced CMPS:

PHP Code:
<?php

require_once('./global.php');
require_once(
'includes/local_links_init.php');
require_once(
'includes/local_links_include.php');

$filter    = array("link.linkmoderate=0""linkhits>0");
$order    "linkhits DESC";

list (
$links$nhits$q) = get_links($filter$order"links_vbalinks");
$collapseobj_custom_ldm_hot $vbcollapse['collapseobj_custom_ldm_hot'];
$collapseimg_custom_ldm_hot $vbcollapse['collapseimg_custom_ldm_hot'];
eval(
'$home[$mods[\'modid\']][\'content\'] .= "' fetch_template('adv_portal_custom_ldm_hot') . '";');

?>
My attempts to get this working with GARS involve putting the main code within the sections of a GARS module template, changing the "require_once" paths to absolute server paths, adding the "require_once" sections to gars_ignition.php, and changing the eval template line to:

PHP Code:
eval('$output .="' fetch_template('adv_portal_custom_ldm_hot') . '";'); 
I have tried a number of variations and combinations, but I can't get past basic errors like:

"Fatal error: Call to a member function on a non-object in global.php"
and
"undefined function $get_links()"

...even though I have the absolute paths set up to global.php and the $get_links() function is defined in the require_once 'local_links_include.php'.


Can anyone point me in the right direction with this? What fundamental changes to which GARS files do I need to make to get a module designed for vBAdvanced to work within a GARS module block?

Thanks for your help.
Reply With Quote
  #2  
Old 03-01-2006, 09:48 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

Looks like it isnt picking up the file with the get_links function.

Can you post your code in its entirety?
Reply With Quote
  #3  
Old 03-02-2006, 05:12 AM
Marris Marris is offline
Junior Member
 
Join Date: Feb 2006
Posts: 23
Geek Article and Review System License Holder 
Default

All the code is in the "links 2.1.3b2.zip" package at vb.org:

Links and Downloads Manager

The full code of the vBAdvanced module is in my first post above. The two files local_links_init.php and local_links_include.php are too large to paste into this post, so I have attached them.

The full mod needs to be installed for the module to work. I have it installed and running on my forum, and the vBAdvanced module is running in a vBAdvanced portal block. However, I don't really need this block on my portal, but I do hope to integrate and display links within a GARS module block.

Another option is to try to write a GARS only module to pull information directly from Links and Downloads Manager without any reference to the vBAdvanced module, but I haven't had a chance to try that route yet.

I thought it might be easier to start from the vBAdvanced module, but that may turn out to be the roundabout way to achive what I want.
Attached Files
File Type: zip includes.zip (21.4 KB, 1 views)

Last edited by Marris; 03-02-2006 at 05:25 AM..
Reply With Quote
  #4  
Old 03-04-2006, 07:08 AM
Marris Marris is offline
Junior Member
 
Join Date: Feb 2006
Posts: 23
Geek Article and Review System License Holder 
Default

Well, I went in a completely different direction. Now, I'm avoiding the vBAdvanced module and Links and Downloads Manager code entirely and trying to pull the data directly from the database into a module.

Unfortunately, I'm still getting errors. Could you please take a look at this and see what might be causing the following error:

Fatal error: Call to a member function on a non-object in offlinks.php on line 4

This is the module code in its' entirety.

PHP Code:
<?PHP
if ($stage == "display")
{
$offlinks=$db->query_read("SELECT linkid, catid
FROM local_linksltoc AS linksltoc
WHERE (catid = 4)
ORDER BY linkid DESC
LIMIT 5"
);

while(
$linksltoc $db->fetch_array($offlinks)) {

      
$offlinksdata=$db->query_read("SELECT linkname, linkdesc, linkurl
      FROM local_linkslink AS linkslink
      WHERE (linkid = " 
$linksltoc['linkid'] . ")");

      
$output .= $output "<tr><td><a href=\"" $linkslink['linkurl'] . "\">" $linkslink['linkname'] . "</a></td></tr>";
}
eval(
'$output.="' fetch_template('GARS_mod_container') . '";');
}    
?>
The tables I am trying to access are in the same database as GARS and vB, but without the same prefix:

Table: local_linksltoc
Fields: linkid, catid

Table: local_linkslink
Fields: linkname, linkdesc, linkurl

Do I have to make changes to GARS to be able to run queries on those two tables? Or perhaps I have a typo or some syntax errors?

Thanks again.
Reply With Quote
  #5  
Old 03-08-2006, 09:52 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

If thats a GARS module, change instances of $dbto $this->db
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
(Updated) GARS - vBAdvanced Block gothic Add-ons 0 06-28-2010 07:08 AM
vBadvanced gars module - bbcode alptraum Geek Article and Review System 1 08-27-2009 11:41 PM
Gars & Vbadvanced 3.0 CMPS astranoc Geek Article and Review System 7 06-11-2008 01:32 AM
Example of unusual integration of GARS and vBadvanced convergent Geek Article and Review System 5 06-03-2007 10:14 PM
GARS/VBAdvanced what am I missing? keithxtreme Geek Article and Review System 4 03-07-2006 10:48 AM


All times are GMT. The time now is 01:40 AM.


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