View Full Version : vba CMPS GARS block
The Geek
03-07-2007, 06:53 PM
Its working now. You had the 'clean output' selected in your vba options.
HTHs
kevnj
03-07-2007, 07:00 PM
oh thats why i posted the screen shots. figured it was something i was doing wrong... what exactly does the clean file output do ?
thanks for taking the time and checking that out for me. :cool:
kevnj
03-07-2007, 07:12 PM
aight what am i missing i see that you had the random reviews on the main page? how do you add a review to the module ?! as you can tell i bought your mod a while back but have neglected to actually use it
The Geek
03-08-2007, 12:14 PM
I have no clie what the clean output does - its a vba thing :) I just found that changing your setting sorted it out :)
What do you mean 'add a review' - isnt it showing a review? Try changing the template to another style and turning on the preview option (I think thats what youre after)
kevnj
03-08-2007, 03:42 PM
I have no clie what the clean output does - its a vba thing :) I just found that changing your setting sorted it out :)
What do you mean 'add a review' - isnt it showing a review? Try changing the template to another style and turning on the preview option (I think thats what youre after)
working now. except the template options of 1 and 2 with showing picture. it wants to link the picture from http://www.mysite.com/forumshttp://www.mysite.com/forums/geek/gars/images/2/9/0/9/xl_lounge.gif :confused:
also is there a way to set 3 reviews horizontal with a picture instead of vertical for the center column?
The Geek
03-08-2007, 05:13 PM
You can try editing modules/gars.php and change:
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options['bburl'] . substr($result['image'], 1);
}
else
{
$result['image'] = $vbulletin->options['bburl'] . $result['image'];
}
to
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = substr($result['image'], 1);
}
else
{
$result['image'] = $result['image'];
}
You should also be able to do what you want by editing your settings and changing them to $vertical = 0; $limit = 3; and $template = 1;
kevnj
03-08-2007, 05:45 PM
You can try editing modules/gars.php and change:
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options['bburl'] . substr($result['image'], 1);
}
else
{
$result['image'] = $vbulletin->options['bburl'] . $result['image'];
}
to
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = substr($result['image'], 1);
}
else
{
$result['image'] = $result['image'];
}
You should also be able to do what you want by editing your settings and changing them to $vertical = 0; $limit = 3; and $template = 1;
Worked perfectly !!! Thanks!! :D
mhc1576
03-20-2007, 10:18 PM
I moved to another host and now this module is very slow.
When enabled it takes between 5-30 sec for the page to load.
Without 0.5 seconds.
I have a feeling that it is the DB query that my new host does not like.
MySQL 5.0.18-standard on a separate DB server.
Any hint how to make the query simplyfied is welcome.
My knowledge of SQL is very limited so I am not able to understand the present query......
Below is all the functions I need.
$forumids = "114,120,151"; // Comma seperated list of forumids
$limit = 5; // How many items to show
$title = "Aktuella artiklar"; // Module Title
$featured = 0; // 1= Only featured items
$url_to_default_image = "types/3/default.jpg"; //Relative URL to default image from geek/gars/images/ folder
$vertical = 0; // 1= Vertical (only for template 1 or 3)
$preview = 1; // 1= Show preview
$ratings = 0; // 1=show ratings
$template = 1; // 1=simple with pic, 2=big with pic, 3=Listing no pic
$order = 0; // 0 = rand, 1=desc, 2=asc
$maxchars = 150; // Maximum amount of chards to snip
$customfields = false; // Set to true to grab the custom fields.
The Geek
03-21-2007, 01:49 PM
Are they really big articles? DOes changing the limit to 1 help?
mhc1576
03-21-2007, 02:27 PM
Changing preview to 0 seems to have fixed the problem.
Limit 1 had no effect
The Geek
03-22-2007, 10:21 PM
Ok, makes sense. Especially on large articles (the entire article contents have to be pulled and parsed before they get cut to preview size).
Glad you have it sorted.
anahowa
03-26-2007, 06:44 AM
is this working with vB Version: 3.6 ?
The Geek
03-26-2007, 08:27 AM
Yup :)
Lionel
03-29-2007, 11:34 AM
I have a custom field, a radio button with four choices. Is it possible to do the below query to get threads for specific checked radio buttons?
$sql = "SELECT g.threadid,g.header_image image, p.title, g.byline" .
($preview ? ", IF(g.synopsis, g.synopsis, p.pagetext) synopsis " : "") .
($ratings ? ",round((g.overall_rating/10),0) author_rating, g.overall_rating author_rating_percent,round((g.avg_rating/10),0) member_rating, g.avg_rating member_rating_percent " : "" ) .
",g.pagecount, g.custom2 $customfields FROM
" . TABLE_PREFIX . "gars g
" . ($customfields ? " INNER JOIN " . TABLE_PREFIX . "gars_custom_values gsv ON gcv.custom_threadid = g.threadid " : "") . "
INNER JOIN " . TABLE_PREFIX . "thread t ON g.threadid = t.threadid
INNER JOIN " . TABLE_PREFIX . "post p ON t.firstpostid = p.postid
WHERE t.visible = 1 AND t.open != 10
" . ($forumids ? " AND t.forumid in ($forumids) " : "" ) . "
" . ($featured ? " AND g.feature_untill> " . TIMENOW : "") . " and sticky='0'
ORDER BY $order LIMIT $limit";
The Geek
03-29-2007, 12:02 PM
hmmm... do you mean to change the threadlist query? If so, it is MUCH harder than that... you would need to hook into the forumdisplay_query hook and add a limit to the ID's to search for... but it may be possible
Lionel
03-29-2007, 03:08 PM
I want to create a different vbadvanced module so I can display only these. So no need for hook :-)
The query is a code snippet from your vbadvanced module
The Geek
03-29-2007, 05:27 PM
hmmm.... Can you provide the fieldids (i.e. gars4) and the values?
Lionel
03-29-2007, 07:27 PM
Field ID 7
values: None of the below, General Team News,In Other News,Training News,Fans News
Thanks.
I am planning to create 4 vbadvanced pages and duplicate 4 gars module. And depending of the value, it will display in appropriate vbadvamced module... I am using the custom fields sort of like categories.
MissKalunji
03-29-2007, 07:36 PM
I sorted it out by doing the following
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options['bburl'] . substr($result['image'], 1);
}
else
{
$result['image'] = $vbulletin->options['bburl'] . $result['image'];
}
replaced the above with
if (!$result['image'])
{
$result['image'] = $vbulletin->options[''] . "/geek/gars/images/" . $url_to_default_image; //replaced options 'bburl'
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options[''] . substr($result['image'], 1); //replaced options 'bburl'
}
else
{
$result['image'] = $vbulletin->options[''] . $result['image']; //replaced options 'bburl'
}
And that made the images work on the template 2 view.
That did the trick
concepts
03-31-2007, 02:59 AM
Got the GEEK GARS and VBA CMPS BLOCK IN "HEAVY" USE AT My SITE
www.UrbanAU.com
I really appreciate the functionality of your mods, really adds "spice" to my site.
:)
Lionel
04-02-2007, 05:51 AM
hmmm.... Can you provide the fieldids (i.e. gars4) and the values?
Geek I had answered the question 3 posts above. Please?
badblu
04-02-2007, 11:37 AM
This might sound stupid but i cannot get it to work at all.
Where should the templates be created in the CMPS thing or in the style templates?
________
Herbalaire best temperature (http://vaporizer.org/reviews)
The Geek
04-03-2007, 09:18 AM
The style templates
The Geek
04-03-2007, 09:29 AM
Lionel:
I suppose that if the custom field is a selection box... then something like:
set you $customfields variable to:
$customfields = 'gcv.gars4';
You will need a way to decide what the value should be. Something like:
switch ($howeveryoudetermineyourpagevalue)
{
case 1:
$valueyouarelookingfor = 'General News'; break;
case 2:
$valueyouarelookingfor = 'ANother value'; break;
case 3:
$valueyouarelookingfor = 'Make sure you escape all \' apostrephes with a backslash'; break;
default:
$valueyouarelookingfor = 'None of the above';
}
Then change the following SQL lines:
" . ($customfields ? " INNER JOIN " . TABLE_PREFIX . "gars_custom_values gsv ON gcv.custom_threadid = g.threadid " : "") . "
" . ($customfields ? " INNER JOIN " . TABLE_PREFIX . "gars_custom_values gcv ON gcv.custom_threadid = g.threadid " : "") . "
WHERE t.visible = 1 AND t.open != 10
to
WHERE t.visible = 1 AND t.open != 10 AND gcv.gars4='$valueyouarelookingfor'
gothic
04-04-2007, 04:25 AM
Anyone have any ideas how to translate the output into two columns?
Thought this had been covered before, but have failed to find any mention of it :(
Thankyou in advance.
FRAiD
04-06-2007, 07:09 PM
is there a way to use this on combination with kerry-anne's sidebar on forum hack?
found on vb.org (http://www.vbulletin.org/forum/showthread.php?t=91888)
The Geek
04-06-2007, 11:14 PM
I am sure it could be modified for that, but not out of the box :D
ProGaming
04-08-2007, 01:06 PM
Sorry if this has been asked, I browsed this thread and didn't see anything about it. This block doesnt parse the html. Notice the links are long?
http://insomniagaming.com
The Geek
04-09-2007, 06:38 PM
not sure why you say it isnt parsing the HTML? It looks like it may not be snipping and auto linking your URLS, but thats another matter (or am I missing something?)
ProGaming
04-09-2007, 11:18 PM
Sorry for a poor description. You are correct with it not snipping and autolink urls. Is there something I can do to fix that? The post shows the url's find. Just on this block.
Thanks Geek. I appreciate your help.
The Geek
04-10-2007, 06:38 AM
ill see if I can add that functionality
ProGaming
04-12-2007, 01:28 AM
Thanks geek Im looking forward to using this block as the heart of my site.
ocean
04-13-2007, 09:51 AM
I was wondering if it's possible to show a different image for the block instead of the header image. Is this possible with the custom fields?
The Geek
04-13-2007, 10:29 AM
Not really without tweaking. I have an update for this that I will be posting very soon that will enable you to do this easier.
jluerken
04-13-2007, 11:39 AM
The problem with this module is that images are getting resized and looking bad then. See screenshot
http://www.clanforums.com/gallery/files/3-gars_vba_module.png
Is there a way to fix this or to show text links only?
Force a fixed width and height for uploaded images would be a good idea
The Geek
04-13-2007, 03:09 PM
It shouldnt be resizing the images... just using the same ones that are being used for the header?
ocean
04-14-2007, 08:09 AM
thanks for your support, the geek. i was wondering how i can link the article's forum for a "view more articles" link.
jluerken
04-14-2007, 08:16 AM
It shouldnt be resizing the images... just using the same ones that are being used for the header?
I updated the templates and now its working. No clue why it resized the images before ... thanks
The Geek
04-14-2007, 11:56 AM
thanks for your support, the geek. i was wondering how i can link the article's forum for a "view more articles" link.
I added a field today in the gars.php file. Downlaod the latest and uploadit to get access to the forumid in the templates. You will just need to put some logic in your templates i.e.
<a href="forumdisplay.php?f=$result[forumid]">View other articles</a>
HTHs
Spiffy
05-06-2007, 06:39 PM
I'm trying to put a second one of these on my home page and have it only take from one forum. I want to do a "tip of the day" thing on it, have that forum not displayed and have it just take from there daily.
Anybody able to help me set this up? I know that you can just copy the module, but where do I tell it to draw from only the one board? Is it in the gars.php? Do I change it there or do I create a separate php like gars2.php and instruct the module to look there. But then what about templates to edit/use?
Thanks, obviously I've been trying to figure this out myself for awhile but when I get somewhere, it usually ends up with a blank page for my home page.
I do need pretty detailed instructions. Thanks so much!!
The Geek
05-06-2007, 09:53 PM
Just copy it as 'gars2.php' then edit the gars2.php and enter the forumids you are after :)
HTHs!
Spiffy
05-06-2007, 10:41 PM
Thanks, I've done just that. Just copied the PHP page and named it gars2.php Then I've copied the original module and told the new one to look at gars2.php and I have the correct forumid in there. But when I make it active, it turns my whole vbAdvanced page blank. I'm so lost on why.
Thanks!
The Geek
05-08-2007, 05:07 PM
Not too sure on that. Blank pages usually mean an error. Check your apache error logs or try setting up a new module in vba.
Spiffy
05-08-2007, 05:13 PM
I forgot to post, I figured it out. I just needed to do a clean upload of the module.
One more question though,
How do I get it to display a new article daily? I know you can set for how long to feature an item. Do I have to set it up so that each one ends on the preceding day? And then set it to descending?
Thanks again!! I'm almost there and this will be the PERFECT thing for what I've been wanting to do. :D
The Geek
05-08-2007, 07:18 PM
You would need logic behind that. In other words, you would most likely need a table that would hold what HAS been shown (and when it whould STOP being shown i.e. after xyz time) as well as the logic to handle getting new ones that havent been shown this iteration etc...
Sadly I cant help with that right now :(
convergent
05-10-2007, 04:34 PM
I want to use this to display news on my home page. Is there anyway to have it split the news by day? So a header "Today"... then the threads from that day, then a header "Yesterday"... then the threads from yesterday, then "May 8", then the threads from that day, etc... until it hits the number of threads specified for the block?
The Geek
05-10-2007, 05:45 PM
Havent tried it, but I suppose you could change:
$result['dateposted'] = vbdate($vbulletin->options['dateformat'], $result['dateline']);
to
$result['dateposted'] = vbdate($vbulletin->options['dateformat'], $result['dateline'], true);
convergent
05-10-2007, 10:03 PM
That didn't change anything visibly... wouldn't I have to make a template change to get an extra header between the days?
The page that I'm doing this on is at http://pdaphonehome.com ... the main news in the center column.
Another thing I'm going to be trying to do at some point is aligning the left margin of text... with different sized images showing up, they are out of alignment. I'm guessing I need to change the template to fix the column width in the left table column, assuming there is a column there... then center the image.
The Geek
05-11-2007, 07:44 AM
The above code I posted will change the date displayed in the postbit to today, yesterday or the date. If you are looking to 'group' results under 'today', 'yesterday', etc... then you are going to need to code logice that will compare days of the timestamp and display accordingly.
Not sure what you mean by 'out of alignment', however any of those types of changes are easy to do via the relevant templates :)
HTHs!
roppolo
05-12-2007, 03:30 PM
Do you think you can take a quick look and tell me how my module looks so screwed up?
1. Image is centered and on top of thread title rather than in a cell adjacent to it.
2. No thread preview even though I have it set for ample characters
The Geek
05-12-2007, 04:27 PM
Its just down to the layout. THere are so many possabilities that in some situations you may need to tweak the templates. In this case, either change the template layout (the one youre using is more ideal for a side column) or tweak the template to suit :)
convergent
05-13-2007, 09:57 PM
I am trying to figure out how to get the articles to all be listed within a single CMPS block, rather than having one article per block. I am using mode 2. I am looking at the code in gars.php and I've tried a variety of changes to no avail. I am thinking that I need to get this block:
if ($vertical && ($template != 2))
{
$modulehtml .= "<tr>$bits</tr>";
}
elseif ($vertical && $template == 2)
{
$mods['title'] = "<a href=\"$bburl/showthread.php?t=$result[threadid]\">$result[title]</a>";
$modulehtml = $bits;
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_module_shell') . '";');
}
else
{
$modulehtml .= $bits;
$x++;
}
and move it outside the while() loop. When I do this, I only get the first article, when I'm asking for 20. My theory was that the while loop would continue adding to $bits buy evaluating the bit 2 template each loop, then it would get stuck into the cmps block once with the code I moved. Either the while() loop isn't looping, or something I moved is what indexes it.
Any ideas how I can accomplish this. Lionel's use of this on the haiti site is what I'm looking for.... one block that says "Latest News", and then the different articles are all in the single block.
Thanks for any help.
convergent
05-13-2007, 10:18 PM
Amazing... after fooling for this for several hours, as soon as I posted that I figured out what the problem was... I was not concatinating the modulehtml... got it working now... just need to sort out the formatting. The results are in the center column at http://pdaphonehome.com
Chris-777
05-17-2007, 11:38 PM
Question,
The whole reason that I bought GARS is that I was told in my pre-purchase thread that I would be able to display HTML-created posts in vBACMPS.
I hope this is the case, as I'm converting now. How do I go about enabling HTML? My forums are down right now because I'm in the middle of converting all of my content, and the articles do not parse any HTML at all when set as a CMPS block.
The Geek
05-18-2007, 07:09 AM
You can get this module to parse HTML articles, however I would really caution against it as it would be too easy to totally break your front page layout.
It was my impression you were not happy with having your articles in HTML as it was a pain?
Praetorian
05-18-2007, 04:08 PM
How can i get them to be all connected rather than seperate tables?
Anyone share?
convergent
05-18-2007, 05:24 PM
How can i get them to be all connected rather than seperate tables?
Anyone share?
You have to make changes to the php file and the template. Here is what I used at http://pdaphonehome.com in the center column for news.
This is my gars.php file... you will need to change the settings of course, and I don't know if this version will work at all if you try to use other than template=2, since I didn't test it with other settings besides these.
<?php
//SETTINGS
$forumids = "55, 68, 74, 78, 83, 84, 85, 194"; // Comma seperated list of forumids
$limit = 20; // How many items to show
$title = "Latest News"; // Module Title
$featured = 0; // 1= Only featured items
$url_to_default_image = "types/3/default.jpg"; //Relative URL to default image from geek/gars/images/ folder
$vertical = 0; // 1= Vertical (only for template 1 or 3)
$preview = 1; // 1= Show preview
$ratings = 0; // 1=show ratings
$template = 2; // 1=simple with pic, 2=big with pic, 3=Listing no pic
$order = 1; // 0 = rand, 1=desc, 2=asc
$maxchars = 800; // Maximum amount of chards to snip
$customfields = false; // Set to true to grab the custom fields.
$parsebb = true; //set to true to parse preview
// END SETTINGS
switch ($order)
{
case 0:
$order = "RAND()"; break;
case 1:
$order = "g.threadid DESC"; break;
default:
$order = "g.threadid ASC";
}
if (!$limit)
{
$limit = "1";
}
$sql = "SELECT g.threadid,g.header_image image, p.title, g.byline, t.forumid, t.dateline, t.postuserid, t.postusername " .
($preview ? ", IF(g.synopsis, g.synopsis, p.pagetext) synopsis " : "") .
($ratings ? ",round((g.overall_rating/10),0) author_rating, g.overall_rating author_rating_percent,round((g.avg_rating/10),0) member_rating, g.avg_rating member_rating_percent " : "" ) .
",g.pagecount, g.custom2 " . ($customfields ? ",gcv.*" : "") . " FROM
" . TABLE_PREFIX . "gars g
" . ($customfields ? " INNER JOIN " . TABLE_PREFIX . "gars_custom_values gcv ON gcv.custom_threadid = g.threadid " : "") . "
INNER JOIN " . TABLE_PREFIX . "thread t ON g.threadid = t.threadid
INNER JOIN " . TABLE_PREFIX . "post p ON t.firstpostid = p.postid
WHERE t.visible = 1 AND t.open != 10
" . ($forumids ? " AND t.forumid in ($forumids) " : "" ) . "
" . ($featured ? " AND g.feature_untill> " . TIMENOW : "") . "
ORDER BY $order LIMIT $limit";
$results = $db->query_read($sql);
$modulehtml = "";
$x = 0;
$bburl = $vbulletin->options['bburl'];
if ($template==2)
{
$vertical = 1;
}
$mods['colspan'] = ($template==2 ? 3 : $x);
$mods['collapse'] = $mods['modid'];
$modcollapse = $vbcollapse["collapseobj_module_" . $mods['modid'] . ""];
$modimgcollapse = $vbcollapse["collapseimg_module_" . $mods['modid'] . ""];
while ($result = $db->fetch_array($results))
{
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options['bburl'] . substr($result['image'], 1);
}
else
{
$result['image'] = $vbulletin->options['bburl'] . $result['image'];
}
if ($parsebb && $template!=3)
{
$result['message'] = $bbcode_parser->do_parse($result['synopsis'], 0, 1, 1, 1);
}
else
{
$result['message'] = strip_bbcode($result['synopsis']);
}
if (strlen($result['message']) > $maxchars)
{
$result['message'] = substr($result['message'], 0, strrpos(substr($result['message'], 0, $maxchars), ' ')) . '...' . ($template!=3 ? construct_phrase($vbphrase['read_more'], $vbulletin->options['bburl'], $result['threadid'], $session['sessionurl']) : "");
}
$result['dateposted'] = vbdate($vbulletin->options['dateformat'], $result['dateline'], true);
eval('$bits = "' . fetch_template('adv_portal_gars_bit' . $template) . '";');
$mods['title'] = $title;
$modulehtml = $modulehtml . $bits;
}
if ($vertical && ($template != 2))
{
$modulehtml .= "<tr>$bits</tr>";
}
elseif ($vertical && $template == 2)
{
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_module_shell') . '";');
}
else
{
$modulehtml .= $bits;
$x++;
}
if ($modulehtml && ($template != 2))
{
if (!$vertical)
{
$modulehtml = "<tr>$modulehtml</tr>";
}
$home[$mods['modid']]['content'] .= $modulehtml;
}
elseif ($modulehtml && $template == 2)
{
$mods['noshell'] = true;
}
?>
And, here is my template 2. Make sure you go through all the classes and change them to ones you have... some of these I created special for this page.
<tr><td class="alt1"><table border="0" align="center" cellpadding="0" >
<tr>
<td>
<table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td align="center" width="110" style="padding-right:10px">
<a href="$bburl/showthread.php?$session[sessionurl]t=$result[threadid]"><img src="$result[image]" border="0" style="border: 1px #000000;padding:2px;" alt="$result[title]" /></a>
</td>
</tr>
</table>
<div class="geeknews1">
<a STYLE="text-decoration:none" href="$bburl/showthread.php?$session[sessionurl]t=$result[threadid]">$result[title]</a></span>
</div>
<if condition="$result[byline]">
<div class="geeknews2">
$result[byline]
</div>
</if>
<div class="smallfont">
$result[dateposted] - <phrase 1="$vboptions[bburl]/member.php?$session[sessionurl]u=$result[postuserid]" 2="$result[postusername]">$vbphrase[by_x]</phrase>
</div>
<br>
<if condition="$result['message']">
<div class="smallfont">
$result[message]
</div>
</if>
<tr>
<if condition="$result['author_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['member_rating']">colspan="2"</if>>
<span class="smallfont">Author rating</span>
</td>
</if>
<if condition="$result['member_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['author_rating']">colspan="2"</if>>
<span class="smallfont">Member rating</span>
</td>
</if>
</tr>
<tr>
<if condition="$result['author_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['member_rating']">colspan="2"</if>>
<img class="inlineimg" src="$stylevar[imgdir_rating]/gars_$result[author_rating].gif" border="0" alt="Author rating: $result[author_rating_percent]%" />
</td>
</if>
<if condition="$result['member_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['author_rating']">colspan="2"</if>>
<img class="inlineimg" src="$stylevar[imgdir_rating]/gars_$result[member_rating].gif" border="0" alt="Member rating: $result[member_rating_percent]%" />
</td>
</if>
</tr>
</td>
</tr>
</table>
</td>
</tr>
Praetorian
05-18-2007, 05:54 PM
Awesome Thanks very much man.
convergent
05-24-2007, 04:00 PM
I need to do something and I'm not quite sure the best approach. I have created a GARS "product page" that has the header, a description, a table of specs (all GARS custom fields), author rating, and user rating. What I'd like to do is add to this page, about ten different lists of threads based on certain criteria, and a block of news like I use the add-on which is the topic of this thread for. I think the best approach is to use a CMPS page for this, because I can use this add-on for the news, and the normal CMPS blocks for the other ten lists of threads. What I'm not sure how to do is to display the main block at the top... the one that would have the GARS page in it... header, overview, table of custom fields, and review ratings. I can probably live without the review blocks, but I need the custom fields for sure.
So questions... one way to do it would be to modify this add-on with a custom template to display everything formatted the way I want it. If that is the case, then I know how to reference the header info, but not the table of custom fields. I see info on the custom fields in the gars.php file, but don't know how to reference the fields in the template. How?
Also, is there a better approach to what I'm trying to do here?
The Geek
05-24-2007, 06:11 PM
It sounds like this is your best first step. You can either modify one of the gars templates you install with this hack, and/or modify it to use other templates. You can modify the templates to include the custom field info, but some fields may need additional formatting.
HTHs!
convergent
05-24-2007, 06:39 PM
OK, I figured out that I need to call the custom field with $result[garsNN], where NN is the field number. I've got a page starting to take shape, done almost completely with hacked versions of this add-on. Then I ran into a brick wall that I didn't think of. I need to be able to call a vBadvanced "page" that is going to point to a specific thread, NOT, the last thread entered. As an example, I want a page for Treo600, Treo650, and Treo700. I will create a GARS thread for each one of them that has a decription of the device and a table of specifications (all custom fields). Users will also be able to enter their rating on that page. That is working fine. I now also have a CMPS page created for each device... ie portal.php?page=treo600, portal.php?page=treo650, etc. I have several blocks created from this add-on... first one shows the formatted overview, with an image, overview, and specs table; next one shows a featured article about the device; next one shows latest news about the device; and last one lists FAQs... which is just a list of thread titles from a specific forum. This is all cool, but how do I call a specific thread for the first block?
I'm starting to think it would better for me to build this totally with GARS instead of CMPS, but I'm not sure how to create these formatted lists of threads on a GARS page?? I'm not sure if you'll be able to see this since its in a hidden forum, but here is a page that I'm working on... http://www.pdaphonehome.com/?page=xda The data doesn't all go together, so don't be concerned about that. The first block is actually a close copy of the GARS article with custom fields... Would there be a way I could add the next couple of blocks to a GARS article. They are both using this Add-On. Could I store in the article custom fields anything like forum IDS that would let me call it?
The Geek
05-24-2007, 07:52 PM
Im not 100% sure I follow what you are trying to do. Do you only need the forumids of the thread that is getting pulled?
convergent
05-24-2007, 08:24 PM
Here is what I want....
Device Page
- Block 1 - Device Info - From Specific GARS Article
- Block 2 - Latest News about Device - Listing (the original purpose of this Add-on)From Specific GARS Forum(s)
- Block 3 - Latest Threads about Device - Traditional Latest Thread Listing from Specific vBulletin Forum
- Block 4 - FAQ Directory about Device - Thread listing (titles only) from Specific NuWiki Forums (still vBulletin threads)
All of this works pretty well on a CMPS page, except for retrieving a specific thread in Block 1. Everything is based on pulling threads from forums, and using criteria like latest date. I want to pull a specific thread, which is what led me to question if I should be just doing this with GARS.... but if I did it in GARS, I could get all of what's in Block 1 out of the box, but have no idea how to do the other blocks.
I've been fooling with the gars.php file and the select statement and can't get it to work. I tried adding a $thread = 84245 to the parameters up top, and then added " . ($thread ? " AND g.threadid = " . $thread : "") . " to the end of the WHERE clause, and it doesn't return anything. The thread ID is what I got from the thread in vBulletin.
convergent
05-24-2007, 09:38 PM
OK, with some help from the vBadvanced forum, I can now pass parameters into GARS.PHP so I should be able to reference a thread if I can figure out the select statement... I don't see why that which I posted in the last reply wouldn't work, but it returns nothing.
By the way, if you want to replace the hard coded parameters in gars.php with ones that you can control per page in the admincp for CMPS, this thread will explain... pretty easy to do... http://www.vbadvanced.com/forum/showthread.php?t=22185
convergent
05-24-2007, 10:05 PM
I think I solved it... I just used the code that was used for forums, and I will handle a list now... not sure what was the problem, but I think I have the ingredients I need to do this now.
convergent
05-24-2007, 11:11 PM
Here is a test page that includes the first 3 of those blocks, plus a feature article block. I will be able to use this add-on to do the FAQ block, but I've not gotten to that one yet. http://pdaphonehome.com/?page=treo755p The beauty of this is that the way it is setup now, I can build new pages for new devices and control it 100% in AdminCP for setting up the page, and then using GARS articles to populate the data. The missing link right now is getting a NuWiki article to show in a CMPS block and then the combo of CMPS/GARS/NuWiki will be able to do dang near anything you can imagine.
convergent
05-25-2007, 03:47 AM
Major setback... I made about 5 or 6 modules and was running fine and then upgraded CMPS to 3.0 because there are some new things that make it easier to replicate pages more easily, which I needed to do... and now all of the GARS blocks are not working. I've got a post in over at vBa forums, and I'll report back if I find out what's causing the problems... right now it looks like this isn't working at all with CMPS 3.0.
The Geek
05-25-2007, 07:28 AM
IIRC, there are some code changes posted by a user a page or two back to make the module 3.0 happy.
I wont be looking at it until it gets closer to gold.
convergent
05-25-2007, 12:38 PM
I'll check that out... I figured I could always "uninstall it" and go back to the old version. The only production page that is using it at this point is my home page which I could also temporarily roll back to the CMPS normal news display... but I am about to venture into building a ton of custom pages with this thing that will all be very similar, and 3.0 makes that a lot easier. By the way, with the ability to do the parameters, you may want to seriously think of making this a "plug-in" product. I am sure there are a lot of people that would be happy to buy it... me being one of them. I think developers such as yourself are missing an opportunity to make a little more coin by pushing these integration modules to be community driven free add-ons. CMPS is in widespread use across a lot of vB sites... and GARS is the best game in town for what it does. You'd probably get more of the non-techie folks buying GARS just because it had a supported Plug-In for CMPS. Pushing all the parameters into the AdminCP makes it as easy to use as if it were part of either product.
convergent
05-25-2007, 12:42 PM
IIRC, there are some code changes posted by a user a page or two back to make the module 3.0 happy.
I wont be looking at it until it gets closer to gold.
I am not seeing any 3.0 code fix in this thread... the only thing I found posted recently was code I posted to get all the articles in one CMPS block... which of course isn't working at present. If you can find the info on 3.0, it would be a big help.
The Geek
05-25-2007, 02:33 PM
Sorry, my mistake :)
This module was just to placate the users that needed a solution. I will look at rewriting for 3.0 when it gets more stable.
Thanks!
convergent
05-25-2007, 02:39 PM
It appears that only template 2 is not working, if I go back to your original code. If I pick template 2, it renders nothing... 1 or 3 seem to work fine. If you could take a look at this, it would be most helpful... In the last if/if/else, if I replace $mods['noshell'] = true; with the code from the non template 2, it does render something, so this line may be part of the problem. I've not gotten it to show more than one line by just fooling around with the code, since I don't totally understand the code... but something in template 2 is amiss for CMPS 3.0
The Geek
05-25-2007, 04:06 PM
If this is for vbacmps 3 then I wont be able to right now as I dont even have it to set up and test it mate.
convergent
05-25-2007, 05:56 PM
OK, I'm making some headway on it... found out one of the templates you are using in that code has been renamed. I have a version working kind of, but I want to see if I can get your original code working on 3.0.
By the way, it was probably wise not to upgrade at this point... I wasn't paying attention and didn't notice the RC in the version... oh well.
convergent
05-25-2007, 06:02 PM
New information that the 'adv_portal_module_shell' template was renamed to 'adv_portal_module_wrapper'. Change this alone fixed some of my problems. I'll post whatever else I find.
Update: It looks like this was the problem on all my modules... although I found a way for them to work without it... changing this reference in both the Geek supplied Add-On, as well as the code block I posted a couple days ago seems to fix the problems of the modules just flat not showing. The fatal error I was getting had to do with my having added AdminCP variables for the settings, and failing to set a default for one of them... this left it unfilled when it came over from 2.x to 3.0 and so it was bombing out. Another thing to be aware of going to 3.0 is that after the upgrade a lot of my site pages were very hosed up until I cleared my browser cache. So, all appears to be working for now, and you need to make a note to change that one reference if you go to 3.0 or this module won't work any longer.
convergent
05-26-2007, 01:39 AM
One more thing on 3.0... you have to select the option in CMPS AdminCP when you define the module to enable Parse BBCode, or you get a fatal error sometimes with the GARS module.
convergent
05-30-2007, 03:33 AM
Me again.... Is there a way to alter the WHERE clause of the SELECT statement to pick rows that have a certain value for a particular custom field. As an example, if I had articles for different cars and a custom field for the car's make, and I wanted to just pull the articles where make="Ford"? How would I do this?
The Geek
05-30-2007, 08:15 AM
sure, im out of town right now so I cant look at the code easily, but try something like:
Turn on the setting to have it pull your custom fields.
Then alter the where clause to be someting like:
AND gcv.garsfieldid = 'ford'
convergent
05-30-2007, 01:17 PM
Thanks, that worked perfectly... now I just need to figure out how to create a selection box that lets me pick one of the choices in the list of choices for that custom field.... kind of like your filter... I am guessing I'd have to do it with javascript and hard code the choices... not ideal, but would probably work.
update... i tried to parameterize this and it got a mysql error... I added the following
$make = "Ford, Chevy";
..... then within the WHERE clause...
" . ($platforms ? " AND gcv.gars3 in ($platforms) " : "" ) . "
The resulting error showed this resolved select statement...
WHERE t.visible = 1 AND t.open != 10
AND gcv.gars3 in (Ford, Chevy)
AND t.forumid in (60)
convergent
05-30-2007, 01:30 PM
OK, figured that out...
$make = " 'Ford', 'Chevy' ";
I'm not sure that's going to work for me, because I wanted to be able to either configure this through AdminCP with a parameter... I guess I could put in the single quotes, but if the absence caused a database error, that wouldn't be good... OR, if I can figure out how to put in a filter that the user can select with... that would be even better.
convergent
05-30-2007, 04:30 PM
OK, I got the user selection working... Here's what I have... http://pdaphonehome.com/?page=learn2
The top block is a list of GARS articles and its showing the header image and thread title. If you pick one, it takes you to another vBadvanced page that shows the GARS article, and also some other blocks of GARS news, and/or GARS feature articles, along with latest threads. If you pick "Review It", you actually get to the GARS article itself.
To do the user selection, I used a simple Javascript selection menu that directs the user to a different url depending on what they pick. In the url is site.com?page=mypage&filter=filterchoice. I didn't realize that those url variables were available to all the .php modules... so I use $_REQUEST to retrieve the value and then alter the SELECT statement to get the rows that have the custom field set to match the filter.
nymyth
06-02-2007, 05:51 PM
Im running vbadvanced 3.0+ and for the life of me cant get this block to show up on my page...any ideas why?
The Geek
06-02-2007, 08:40 PM
I suppose it will need to be rewritten for 3.0. I havent looked into module changes in vbacmps yet as it is still pre-release.
corey
06-02-2007, 09:20 PM
I suppose it will need to be rewritten for 3.0. I havent looked into module changes in vbacmps yet as it is still pre-release.
All you have to do is change the name of the vbadvanced template from 'adv_portal_module_shell' to 'adv_portal_module_wrapper'
Its on or around line 105.
convergent
06-03-2007, 03:58 AM
Yep, read back through the last 4 or 5 pages of posts and you'll find this discussed.
nymyth
06-03-2007, 07:46 PM
ok i made that change and it shows up nice. How do I get all the ARTICLES to show up inside one BLOCK and the IMAGE is not showing either, its pointing to this: www.sitename.com/forum/http://www.sitename.com/forum/gars... its doubling up on the prefix.....any ideas guys?
Thanks.
nymyth
06-03-2007, 08:25 PM
ok figured how to to put everything into one block...just cant figure out the image problem
convergent
06-03-2007, 09:13 PM
What problem are you having. I posted some code back a few pages that put things in one block and format the image.
nymyth
06-04-2007, 12:00 AM
the problem im having is getting the images to show up. I used the code you provided a couple a pages ago, but i just get a broken image......can u help me out
convergent
06-04-2007, 05:18 AM
Do you have a url to show the problem? Are you able to upload header images and see them with the standard GARS thread and forum views?
nymyth
06-04-2007, 02:13 PM
ive enabled the block so you can see it. If you right click properties the broken image youll see this as the url "http://www.nysports365.com/forumhttp://www.nysports365.com/forum/geek/gars/images/3/thumb_yankeesmets.jpg"
I copied and pasted your code from page 31 i believe....standard GARS works fine...its just doubling up the url
convergent
06-04-2007, 02:30 PM
Hmmm... that is odd. The image url is coming from $result[image] and the url should be the actual url to the image stored with the thread. Are you using the code I posted exactly, or have you made changes to it? Is it possible the $bburl got added to $result[image] in the template? If not, the next thing i'd do is use phpmyadmin and see what is actual stored in the image field in the database. If its correct there, then somewhere in the module php or the template the $bburl is getting added to it.
nymyth
06-04-2007, 02:51 PM
The code is exactly as you posted. This was happening even with the code that was provided by the original mod.
TEMPLATE:
<a href="$bburl/showthread.php?$session[sessionurl]t=$result[threadid]"><img src="$result[image]" border="0" style="border: 1px #000000;padding:2px;" alt="$result[title]" /></a>
nymyth
06-04-2007, 02:55 PM
What table am i supposed to be looking at to verify the image field?
This is what the header image is showing for GARS...
http://www.nysports365.com/forum/geek/gars/images/3/thumb_yankeesmets.jpg
After turning off the cache, I was finally able to see the gallery to change the image header. Now the double URL problem exists as nymyth is posting about.
Version is 2.1.8c
nymyth
06-04-2007, 08:53 PM
now im relieved that im not the only one...lol
Peace
nymyth
06-04-2007, 09:18 PM
LPH i see you got yours to work for Insane Politics, how did you do it?
nymyth
06-04-2007, 09:35 PM
well i finally got mines to work, however if someone can just make sure what i did wont mess anything else up:
while ($result = $db->fetch_array($results))
{
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options['bburl'] . substr($result['image'], 1);
}
else
{
$result['image'] = $vbulletin->options['bburl'] . $result['image'];
}
in the last part i took out the $vbulletin->options['bburl'] so it reads the following:
while ($result = $db->fetch_array($results))
{
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options['bburl'] . substr($result['image'], 1);
}
else
{
$result['image'] = $result['image'];
}
LPH i see you got yours to work for Insane Politics, how did you do it?
Actually, I shut off the cache settings and gars works properly, except the CMPS image url duplication.
Sorry for the delay. I had to take time off because my frustration in the script. I'll keep plugging along.
convergent
06-05-2007, 12:31 AM
Looks like you guys figured it out. I expect there is probably some option setting you have that is different from what I have that is causing the problem.
nymyth
06-05-2007, 02:25 AM
Actually, I shut off the cache settings and gars works properly, except the CMPS image url duplication.
Sorry for the delay. I had to take time off because my frustration in the script. I'll keep plugging along.
well if you do what i said in my last post, it should fix your problem
Peace
nymyth
06-11-2007, 03:12 PM
Can somebody help me with this:
http://www.nysports365.com/
You'll see its working great, I wanted to know if someone can tell me how to move the image to the left and have the text sit right next to it. I can get it to the left but the text is always showing up underneath it...
Thanks.
convergent
06-11-2007, 08:25 PM
If you are using what I loaded, you should be able to just swap the two cells (td) in the template. By the way, I really like the overlapping image and block of text... very unique.
nymyth
06-12-2007, 02:58 AM
thanks for the compliments, and I really like how you used GARS to such a high level...
tuwebfacil
06-13-2007, 06:07 AM
Is this work with latest version? (vBulletin 3.6.7 PL1, GARS 2.1.8c & vBaCMPS 3.0RC1)
Thank you....
The Geek
06-13-2007, 12:22 PM
works with the latest GARS and vB, however IIRC, there are some changes a couple pages back for vbacmps 3 RC
HTHs!
convergent
06-13-2007, 01:12 PM
There was one module that had a name change in vBaCMPS 3.0RC1... the wrapper module. If you don't make that change in the code it won't work.
Grievy
06-18-2007, 04:02 PM
How can I get my attachments to show up in this block? If I include an attachment it just appears as a text link saying Attachment # with a link to the attachment.
Grievy
06-18-2007, 09:35 PM
I was also wondering if somebody might be able to point me in the direction of how to go about adding views and comments to this for each thread?
I'm not too familiar with coding when it comes to pulling info from a database.
convergent
06-26-2007, 07:10 PM
I was also wondering if somebody might be able to point me in the direction of how to go about adding views and comments to this for each thread?
I'm not too familiar with coding when it comes to pulling info from a database.
It will require you to do some coding to get that to work. Basically you'll need to modify the sql query to add the fields you want if they aren't already there, then you will need to add the fields to the appropriate template.
GrendelKhan{TSU}
06-29-2007, 01:49 PM
WOOT!! working fine :)
roppolo
07-04-2007, 02:25 AM
I keep getting an image path problem....
Here are my settings:
Absolute path:
/home/batoycom/public_html/forum/geek/gars/images
URL to image folder:
/geek/gars/images
With these settings, the image upload and shows up fine in the actual article thread, however, on the main page in the gars module, I'm getting a red X... it seems like there's an extra /forum in the url for the image. Where should I be editing that path so its accurate? When I changed the path to the folder, it reversed so that the image showed up on the main page, but the article had a red X. Im confused :/
roppolo
07-04-2007, 02:48 AM
Also, as strange as it seems, I am only able to use Template 1 to get anything to show up on the main page even though its not very clean (yet). When I change gars.php to template 2, i get a big blank area. Nothing there as if the module didnt even exist. Any idea on this?
The Geek
07-04-2007, 08:25 AM
You need to check your settings to make sure that the path to the images folder is absolute (i.e. the full URL).
If you are using vbacmps 3x then you need to check through this thread to find changes to make it work there :)
HTHs!
roppolo
07-04-2007, 12:21 PM
You need to check your settings to make sure that the path to the images folder is absolute (i.e. the full URL).
If you are using vbacmps 3x then you need to check through this thread to find changes to make it work there :)
HTHs!
Ok, i got template 2 fixed by changing to 'wrapper', but i'm confused about your first statement.
The image path is /home/mysite/public_html...../
You are telling me that this should be absolute, the full url? I thought the path and the url were different?
Here are the exact urls being called for this one particular image:
In the module on the front page, its looking for:
http://www.batonrougetoday.com/forum/forum/geek/gars/images/1/thumb_6743075_BG1.jpg
In the actual article, the url is:
http://www.batonrougetoday.com/forum/geek/gars/images/1/thumb_6743075_BG1.jpg
Im getting and extra /forum for the image on the mainpage and i cant figure out where that's coming from
Edit: This post (http://www.thevbgeek.com/showpost.php?p=19680&postcount=347)fixed the image problem
Anyone know how would i go about adding the original posters name under the article link?
NEVER MIND, installed the latest version and all is great!
ericguttormson
07-06-2007, 09:30 PM
I love GARS!
I bought it today.
Unfortunately I cannot get the CMPS module to display. Well actually I can get templates 1 and 3 to display but I want the template with the associated article text which I believe is template 3.
So.... what might I be doing wrong?
The Geek
07-06-2007, 10:19 PM
is this with vbacmps 3?
ericguttormson
07-06-2007, 10:52 PM
is this with vbacmps 3?Sorry.
Yes.... this is with vbacmps 3
ericguttormson
07-06-2007, 10:53 PM
Here is the test page.
http://www.bigwestracing.com/index.php?pageid=test
It should show up right in the center column. I can get templates 1 and 3 to show up but they are not what I want.
ericguttormson
07-07-2007, 05:32 AM
There was one module that had a name change in vBaCMPS 3.0RC1... the wrapper module. If you don't make that change in the code it won't work.I wonder if what you describe is my problem.
What in the code should we change?
ericguttormson
07-07-2007, 06:14 AM
Whoa!!! By editing the gars.php file and changing adv_portal_shell to adv_portal_wrapper I got my mod to show up.
But the stories have no text!
http://www.bigwestracing.com/index.php?pageid=test
I have messed with the settings all night. What am I missing?
The Geek
07-07-2007, 07:35 AM
Ill see if I can get some tim in today or tomorrow to update this for 3x
ericguttormson
07-13-2007, 03:39 AM
I did finally get mine working although I am not sure what I did to make it work. :D
I am using vba CMPS 3.0, and want to use gars block with template 1.
I can't show the thumbnail of the link in the block.
the link to the thumb nail in the block is like following:
http://abc.orghttp://abc.org/geek/gars/images/thumb_123.jpg
Where and how I can fix this?
Would you advice to me?
I am using vba CMPS 3.0, and want to use gars block with template 1.
I can't show the thumbnail of the link in the block.
the link to the thumb nail in the block is like following:
http://abc.orghttp://abc.org/geek/gars/images/thumb_123.jpg
Where and how I can fix this?
Would you advice to me?
I'm kinda in the same boat. I upgraded to 3.0 and would realy like to have my gars module back.:D
Torqued
07-20-2007, 01:22 PM
I am using vba CMPS 3.0, and want to use gars block with template 1.
I can't show the thumbnail of the link in the block.
the link to the thumb nail in the block is like following:
http://abc.orghttp://abc.org/geek/gars/images/thumb_123.jpg
Where and how I can fix this?
Would you advice to me?
I'm having the same problem w/ CMPS 2.2.1. :(
I'm kinda in the same boat. I upgraded to 3.0 and would realy like to have my gars module back.:D
Fixed!
post # 324 by convergent on page 33 solved my problems. Changed 'adv_portal_module_shell' to 'adv_portal_module_wrapper' and it’s working!
concepts
07-23-2007, 08:15 PM
wow... where exactly do we have to go to change the path to pull from? it seems like an easy fix (for the GEEKthat is) :)
put aside those projects for a moment and give us ol' commoners a hand will ya pal?
haha... its not about support.. its about that warm and fuzzy feeling you get in helping a few entreprenuers make their sites look beautiful with those vB Geek additionals.
hehe...
nymyth
07-25-2007, 01:51 PM
^^open up GARS.PHP, and look for this:
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_module_shell') . '";');
replace with this:
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_module_wrapper') . '";');
Thats it.
PS. Please not, ONLY template 2 works for this version of the CMPS block.
concepts
07-28-2007, 05:33 PM
okay.. did the change.. still no luck.. I did a fresh install from scratch with this... changed the edit you mentioned.. the text shows, but still no header.
concepts
07-28-2007, 05:51 PM
<td width="27" style="padding-right:10px"><a href="$bburl/showthread.php?$session[sessionurl]t=$result[threadid]"><img src="$result[image]" border="0" style="border: 1px #000000;padding:2px;" alt="$result[title]" /></a></td>
</tr>
this is where the image is being pulled from thats causing some sort of problem in template 2....
nymyth
07-30-2007, 02:56 PM
If the image isnt showing up, follow this post...i posted a fix to it:
http://www.thevbgeek.com/showpost.php?p=19680&postcount=347
rlpartida
08-02-2007, 07:28 PM
Hello,
I have this module installed at my homepage, but once I try to add it to another page I get this error:
Fatal error: Call to a member function on a non-object in /home/fxreview/public_html/forexreviews/modules/gars.php on line 81
Anyone knows whats happening?
Thx
markmarucot
08-04-2007, 03:56 PM
You have to make changes to the php file and the template. Here is what I used at http://pdaphonehome.com in the center column for news.
This is my gars.php file... you will need to change the settings of course, and I don't know if this version will work at all if you try to use other than template=2, since I didn't test it with other settings besides these.
<?php
//SETTINGS
$forumids = "55, 68, 74, 78, 83, 84, 85, 194"; // Comma seperated list of forumids
$limit = 20; // How many items to show
$title = "Latest News"; // Module Title
$featured = 0; // 1= Only featured items
$url_to_default_image = "types/3/default.jpg"; //Relative URL to default image from geek/gars/images/ folder
$vertical = 0; // 1= Vertical (only for template 1 or 3)
$preview = 1; // 1= Show preview
$ratings = 0; // 1=show ratings
$template = 2; // 1=simple with pic, 2=big with pic, 3=Listing no pic
$order = 1; // 0 = rand, 1=desc, 2=asc
$maxchars = 800; // Maximum amount of chards to snip
$customfields = false; // Set to true to grab the custom fields.
$parsebb = true; //set to true to parse preview
// END SETTINGS
switch ($order)
{
case 0:
$order = "RAND()"; break;
case 1:
$order = "g.threadid DESC"; break;
default:
$order = "g.threadid ASC";
}
if (!$limit)
{
$limit = "1";
}
$sql = "SELECT g.threadid,g.header_image image, p.title, g.byline, t.forumid, t.dateline, t.postuserid, t.postusername " .
($preview ? ", IF(g.synopsis, g.synopsis, p.pagetext) synopsis " : "") .
($ratings ? ",round((g.overall_rating/10),0) author_rating, g.overall_rating author_rating_percent,round((g.avg_rating/10),0) member_rating, g.avg_rating member_rating_percent " : "" ) .
",g.pagecount, g.custom2 " . ($customfields ? ",gcv.*" : "") . " FROM
" . TABLE_PREFIX . "gars g
" . ($customfields ? " INNER JOIN " . TABLE_PREFIX . "gars_custom_values gcv ON gcv.custom_threadid = g.threadid " : "") . "
INNER JOIN " . TABLE_PREFIX . "thread t ON g.threadid = t.threadid
INNER JOIN " . TABLE_PREFIX . "post p ON t.firstpostid = p.postid
WHERE t.visible = 1 AND t.open != 10
" . ($forumids ? " AND t.forumid in ($forumids) " : "" ) . "
" . ($featured ? " AND g.feature_untill> " . TIMENOW : "") . "
ORDER BY $order LIMIT $limit";
$results = $db->query_read($sql);
$modulehtml = "";
$x = 0;
$bburl = $vbulletin->options['bburl'];
if ($template==2)
{
$vertical = 1;
}
$mods['colspan'] = ($template==2 ? 3 : $x);
$mods['collapse'] = $mods['modid'];
$modcollapse = $vbcollapse["collapseobj_module_" . $mods['modid'] . ""];
$modimgcollapse = $vbcollapse["collapseimg_module_" . $mods['modid'] . ""];
while ($result = $db->fetch_array($results))
{
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options['bburl'] . substr($result['image'], 1);
}
else
{
$result['image'] = $vbulletin->options['bburl'] . $result['image'];
}
if ($parsebb && $template!=3)
{
$result['message'] = $bbcode_parser->do_parse($result['synopsis'], 0, 1, 1, 1);
}
else
{
$result['message'] = strip_bbcode($result['synopsis']);
}
if (strlen($result['message']) > $maxchars)
{
$result['message'] = substr($result['message'], 0, strrpos(substr($result['message'], 0, $maxchars), ' ')) . '...' . ($template!=3 ? construct_phrase($vbphrase['read_more'], $vbulletin->options['bburl'], $result['threadid'], $session['sessionurl']) : "");
}
$result['dateposted'] = vbdate($vbulletin->options['dateformat'], $result['dateline'], true);
eval('$bits = "' . fetch_template('adv_portal_gars_bit' . $template) . '";');
$mods['title'] = $title;
$modulehtml = $modulehtml . $bits;
}
if ($vertical && ($template != 2))
{
$modulehtml .= "<tr>$bits</tr>";
}
elseif ($vertical && $template == 2)
{
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_module_shell') . '";');
}
else
{
$modulehtml .= $bits;
$x++;
}
if ($modulehtml && ($template != 2))
{
if (!$vertical)
{
$modulehtml = "<tr>$modulehtml</tr>";
}
$home[$mods['modid']]['content'] .= $modulehtml;
}
elseif ($modulehtml && $template == 2)
{
$mods['noshell'] = true;
}
?>
And, here is my template 2. Make sure you go through all the classes and change them to ones you have... some of these I created special for this page.
<tr><td class="alt1"><table border="0" align="center" cellpadding="0" >
<tr>
<td>
<table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td align="center" width="110" style="padding-right:10px">
<a href="$bburl/showthread.php?$session[sessionurl]t=$result[threadid]"><img src="$result[image]" border="0" style="border: 1px #000000;padding:2px;" alt="$result[title]" /></a>
</td>
</tr>
</table>
<div class="geeknews1">
<a STYLE="text-decoration:none" href="$bburl/showthread.php?$session[sessionurl]t=$result[threadid]">$result[title]</a></span>
</div>
<if condition="$result[byline]">
<div class="geeknews2">
$result[byline]
</div>
</if>
<div class="smallfont">
$result[dateposted] - <phrase 1="$vboptions[bburl]/member.php?$session[sessionurl]u=$result[postuserid]" 2="$result[postusername]">$vbphrase[by_x]</phrase>
</div>
<br>
<if condition="$result['message']">
<div class="smallfont">
$result[message]
</div>
</if>
<tr>
<if condition="$result['author_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['member_rating']">colspan="2"</if>>
<span class="smallfont">Author rating</span>
</td>
</if>
<if condition="$result['member_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['author_rating']">colspan="2"</if>>
<span class="smallfont">Member rating</span>
</td>
</if>
</tr>
<tr>
<if condition="$result['author_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['member_rating']">colspan="2"</if>>
<img class="inlineimg" src="$stylevar[imgdir_rating]/gars_$result[author_rating].gif" border="0" alt="Author rating: $result[author_rating_percent]%" />
</td>
</if>
<if condition="$result['member_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['author_rating']">colspan="2"</if>>
<img class="inlineimg" src="$stylevar[imgdir_rating]/gars_$result[member_rating].gif" border="0" alt="Member rating: $result[member_rating_percent]%" />
</td>
</if>
</tr>
</td>
</tr>
</table>
</td>
</tr>
Nice hack! :) How can I add pagination for this?
wolf32
08-09-2007, 05:44 PM
Is there any way to display this module (with template 2) horizontally in the same column?
ex.
____ ______
[____][____]
wolf32
08-10-2007, 05:22 PM
...*bump* :)
I am having the same problem. Have you found a solution yet?
Hello,
I have this module installed at my homepage, but once I try to add it to another page I get this error:
Fatal error: Call to a member function on a non-object in /home/fxreview/public_html/forexreviews/modules/gars.php on line 81
Anyone knows whats happening?
Thx
cynthetiq
09-16-2007, 03:17 PM
Does anyone have a problem with the collapsing buttons? I cannot collapse multiple items that are presented from GARS. It will only collapse the top most one.
croft
09-29-2007, 06:35 AM
Fixed changing the wrapper :)
croft
09-30-2007, 09:51 AM
Now i got a new problem. Check the screenshot. I f you know how to fix it please let me know. Very strange :(
convergent
10-03-2007, 03:02 PM
Its been a while, but I'd guess that your table tags are mucked up. I'd probably suggest you get the template code into a desktop editor and lay out out to make sure your table rows and cells are where they are supposed to be.
nymyth
10-21-2007, 11:43 PM
does anyone know how to get the filter into this. I'm trying to get only certain articles to show up in this module. So if I have a filter marked BASEBALL, how would i get only the BASEBALL articles to show up in this module?
convergent
10-24-2007, 06:55 PM
Are you talking about the thing I did, or the standard GARS filter?
nymyth
10-25-2007, 06:47 PM
^I didnt know you had made a Filter......im using the standard gars filter.....
convergent
10-26-2007, 04:15 PM
http://pdaphonehome.com/index.php?page=info
Believe it or not, this page is a hacked up version of this add-on. And, if you pick one of those devices, then the following pages are also a single vBadvanced page that is passed a variable to tell it which one's data to show... and that data ties it to the GARS forum thread where it will find the custom fields to populate it.
This is just ONE of the reasons why I'm highly annoyed that GARS appears to now be a dead end.
nymyth
10-29-2007, 03:47 PM
anychance you can show me how to do this?
I have a NY Sports site and I want to do the following (I have the GARS Filter on): The filter has Baseball, Basketball, Hockey, Football, Soccer
I want to create individual pages for the Yankees, Mets, Giants, Jets etc and I want these pages to only show articles from the filters I have mentioned above.....is this possible?
rlpartida
10-31-2007, 01:12 AM
I second that, I will really appreciate if you show us how to do that corvengent... perhaps creating a new thread about it?
Cheers,
convergent
11-02-2007, 04:30 PM
With GARS being essentially dead, I don't have the desire to put together a whole how-to on this. I will tell you the key ingredients for building it. If you just want to create a selector like this and will create separate pages for each, then this code block can help you accomplish it...
<b>Filter:</b>
<form name="platform">
<select style="font-size:12px;color:#006699;font-family:verdana;background-color:#ffffff;" name="menu" onChange="location=document.platform.menu.options[document.platform.menu.selectedIndex].value;">
<option value=''>Platform</option>
<option value="http://pdaphonehome.com/?page=learn2">All</option>
<option value="http://pdaphonehome.com/?page=learn2&filter=palm">Palm</option>
<option value="http://pdaphonehome.com/?page=learn2&filter=wm-pocketpc">Windows Mobile - Pocket PC</option>
<option value="http://pdaphonehome.com/?page=learn2&filter=wm-smartphone">Windows Mobile - Smartphone</option>
<option value="http://pdaphonehome.com/?page=learn2&filter=symbian">Symbian</option>
<option value="http://pdaphonehome.com/?page=learn2&filter=other">Blackberry, Other</option>
</select>
</form>
I have created a bunch of different custom iterations of the vbacmps php file that is the subject of this thread. In that file, it calls the template for the module. This form code goes in that template.
RaceJunkie
01-03-2008, 11:19 PM
Does this module work with the current version of Gars and vB? I need a way to show my articles posted on my vbAdvanced CMPS.
RaceJunkie
01-04-2008, 12:58 AM
I just installed this on my forum but it does not show any of the article that is posted. It shows the title twice. I have tried all the settings with no luck.
$template = 2; Nothing shows.
$template = 1; Title shows twice stacked. (Centered in the center module)
$template = 3; Only title shows but shifts to the left of the module.
vBadvanced CMPS v3.0 RC1
vBulletin Version 3.6.8
Here are my settings
//SETTINGS
$forumids = "240"; // Comma seperated list of forumids
$limit = 25; // How many items to show
$title = "News"; // Module Title
$featured = 0; // 1= Only featured items
$url_to_default_image = "http://www.localracechat.com/forums/geek/gars/images/types/1/"; //Relative URL to default image from geek/gars/images/ folder
$vertical = 1; // 1= Vertical (only for template 1 or 3)
$preview = 1; // 1= Show preview
$ratings = 0; // 1=show ratings
$template = 3; // 1=simple with pic, 2=big with pic, 3=Listing no pic
$order = 1; // 0 = rand, 1=desc, 2=asc
$maxchars = 400; // Maximum amount of chards to snip
$customfields = false; // Set to true to grab the custom fields.
$parsebb = true; //set to true to parse preview
// END SETTINGS
Hi,
vba CMPS GARS block (http://www.thevbgeek.com/showthread.php?t=1439) isn't working for me (vb 3.6.8 and gars latest version) so i'd like to know if there is a way to show the header image of gars entries inside the news displayed on my homepage, that's powered by vbadvanced!
thanks! ;)
RaceJunkie
01-06-2008, 03:33 PM
Not sure about how to do the images but for me (since I don't need the images) I just copied vBAdvanced default news module and named it Gars News. It shows all my articles posted like a normal forum.
http://www.localracechat.com/
yes, it works also for me. but i want to display also the images...and this module doesn't work!
convergent
01-10-2008, 01:09 PM
Hi,
vba CMPS GARS block (http://www.thevbgeek.com/showthread.php?t=1439) isn't working for me (vb 3.6.8 and gars latest version) so i'd like to know if there is a way to show the header image of gars entries inside the news displayed on my homepage, that's powered by vbadvanced!
thanks! ;)
You guys need to make sure to read through the thread. There were some problems with it at some point on the upgrades to vBulletin, but I posted a version that worked.
For the header image thing, I believe I'm doing what you want at http://pdaphonehome.com and I've posted most of my stuff in this thread if you go back through it.
miyukichii
01-18-2008, 11:33 PM
You guys need to make sure to read through the thread. There were some problems with it at some point on the upgrades to vBulletin, but I posted a version that worked.
For the header image thing, I believe I'm doing what you want at http://pdaphonehome.com and I've posted most of my stuff in this thread if you go back through it.
If i want to place a block with an advertising code under feature articles, how to make that ?
beekeeper
01-31-2008, 01:55 PM
Since GARs is back, can somebody please post a "final" instruction set and module on how to get this Mod working. I've read through the many posts and I understand a few people have it working. I'm just having a hard time getting this mod to work on my site, and I'm sure others are also facing difficulty.
Thanks in advance.
gothic
02-14-2008, 06:35 AM
*Gothic frustrated, and slaps himself with wet haddock to keep awake......
This post is in two parts.
Firstly the layout/output.
When I view page source I am getting the most curious artifacts. There are a couple of spurious empty tags floating at the end of every GARS thread when displayed on the vBA portal using this mod. See below:
<div style="padding-bottom:15px">
<table align="center" border="0" cellpadding="6" cellspacing="1" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat" colspan="3">
<a href="#top" onclick="return toggle_collapse('module_31')" style="float:right"><img alt="" border="0" id="collapseimg_module_31" src="images/buttons/collapse_tcat.gif" /></a>
<span class="smallfont"><strong>» <a href="http://192.168.1.11/showthread.php?t=4401">Office update disables MS files</a></strong></span></td>
</tr>
</thead>
<tbody id="collapseobj_module_31" style="">
<tr>
<td class="thead">
03-01-2008 - by <a href="http://192.168.1.11/member.php?u=3" rel="nofollow">gothic</a>
</td>
</tr>
<tr>
<td class="alt1" valign="top">
<span style="float: right; margin: 4px 4px 4px 0px"><a href="http://192.168.1.11/showthread.php?t=4401"><img src="http://192.168.1.11/geek/gars/images/types/3/default.jpg" border="0" style="border: 1px #000000;padding:2px;" alt="Office update disables MS files" /></a></span>
<div class="smallfont">
<i><b>SOURCE: TheRegister<br />
</b></i>Microsoft's Service Pack 3 for Office 2003 blocks you from opening certain file formats the software giant deems less secure - including its own.<br />
The service pack will block access to files including some Office Excel 2003, MS Office PowerPoint 2003 and MS Office Word 2003, it has emerged, as well as Corel Draw formats.<br />
<script type="text/javascript"> document.write('\x3Cscript... <span class="smallfont">[<a href="http://192.168.1.11/showthread.php?t=4401">Read More</a>]</span></div>
<tr>
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
</div>
It's those spare bits at the end:
<tr>
</td>
</tr>
<tr>
</tr>
This happens at the end of every thread ???? I have been through the code in Template 2 and the gars.php but cannot work out where they are generated. Any ideas?
Part two:
Can anybody suggest a way to convert the output to display in 2 (two) columns? as in the image (this using a modded vBA News module)
KCiKees
02-27-2008, 01:39 AM
Since GARs is back, can somebody please post a "final" instruction set and module on how to get this Mod working. I've read through the many posts and I understand a few people have it working. I'm just having a hard time getting this mod to work on my site, and I'm sure others are also facing difficulty.
Thanks in advance.
I'LL Second.......................
gothic
02-29-2008, 04:53 PM
Bump.......
KCiKees
03-01-2008, 04:07 AM
You guys need to make sure to read through the thread. There were some problems with it at some point on the upgrades to vBulletin, but I posted a version that worked.
For the header image thing, I believe I'm doing what you want at http://pdaphonehome.com and I've posted most of my stuff in this thread if you go back through it.
Would you be so kind to share your 'adv_portal_newsbits' template with us, I really like that 2 column and GARS header image in the 'adv_portal_newsbits' template?
Thxns a million
Morgan
03-02-2008, 05:16 AM
... It's those spare bits at the end:
<tr>
</td>
</tr>
<tr>
</tr>
This happens at the end of every thread ???? I have been through the code in Template 2 and the gars.php but cannot work out where they are generated. Any ideas?
...
Not familiar with this mod, but check where the template conditionals are in the adv_portal_gars_bit2 template and try swapping the positions of the template conditionals and HTML tags:
<tr> <if condition="$result['author_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['member_rating']">colspan="2"</if>>
<span class="smallfont">Author rating</span>
</td></if>
<if condition="$result['member_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['author_rating']">colspan="2"</if>>
<span class="smallfont">Member rating</span>
</if>
</td>
</tr>
<tr> <if condition="$result['author_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['member_rating']">colspan="2"</if>>
<img class="inlineimg" src="$stylevar[imgdir_rating]/gars_$result[author_rating].gif" border="0" alt="Author rating: $result[author_rating_percent]%" /></td></if>
<if condition="$result['member_rating']">
<td class="alt1" style="white-space:nowrap;" <if condition="!$result['author_rating']">colspan="2"</if>>
<img class="inlineimg" src="$stylevar[imgdir_rating]/gars_$result[member_rating].gif" border="0" alt="Member rating: $result[member_rating_percent]%" />
</td></if></tr>
gldtn
03-07-2008, 12:19 AM
I wanted to give this mod a go with with vb3.7, but I don't even get any type of output out of the original hack release and instructions.. Has anyone here tried it?
Thanks!
Would you be so kind to share your 'adv_portal_newsbits' template with us, I really like that 2 column and GARS header image in the 'adv_portal_newsbits' template?
Thxns a million
Yes, please, does anyone know how to achieve this affect? (the GARS header insider the vBA news module?)
Rainyleaves
03-28-2008, 08:50 AM
Nice Mod.
Just Installed.
stevebullman
04-06-2008, 10:10 PM
I cant even get it to display any content, followed the instructions added the module and it wont show on the home page.
Nikoo
04-17-2008, 10:13 AM
Hi,
I wonder if you do exactly as the instructions would this hack work whit vbulletin 3.6 because i did and it don't works???
im mean geeks info!!!
Anybody :confused:
Morgan
04-17-2008, 04:49 PM
This modification is dated, being made for vB 3.5, probably for vBa CMPS 2.x, and as much of a pain that it poses, the only thing I can suggest is to read through the thread and see if someone posted a solution. Perhaps this (http://www.thevbgeek.com/showpost.php?p=18909&postcount=306) or some other post will help you.
Nikoo
05-07-2008, 06:33 PM
Hi,
Finally i manage to put a modules for my vbadvanced what i wonder now is how to change they style.
In this picture whit my module, i dont like the green field, i just want it to dissapear? any ideas?
Morgan
05-08-2008, 12:56 PM
Maybe CSS, not sure, look at the HTML source for the page to determine from where the green is being generated.
Nikoo
05-09-2008, 01:29 AM
Thanks, i finally have a working module. ( :
But i have a question is it possible to resize the picture of the module, i think its to big and would like a little smaller picture in the module,
any idea?
Morgan
05-09-2008, 01:49 AM
Perhaps width and/or height attributes: http://www.htmlcodetutorial.com/images/_IMG_WIDTH.html
Kreativmind
05-22-2008, 03:47 AM
does somebody have this mod working with vbuleltin 3.7 and last evrsion of vbadvanced? it's not working :( and that's mainly for it's integration with vbadvanced tthat i bought GARS...
Morgan
05-22-2008, 01:31 PM
This modification is dated, being made for vB 3.5, probably for vBa CMPS 2.x, and as much of a pain that it poses, the only thing I can suggest is to read through the thread and see if someone posted a solution. Perhaps this (http://www.thevbgeek.com/showpost.php?p=18909&postcount=306) or some other post will help you.
sweeps78
06-05-2008, 01:20 PM
I'd also love to see this module working for 3.7:D Unless it was mentioned in one of the 11 pages of comments, from the looks of the mod body, this module hasn't been updated since it's release?
maikeul
06-09-2008, 11:59 AM
What is the last vbulletin version and vbavanced version working with this module unoficially, doesn't somebody know?
thx
Morgan
06-10-2008, 04:42 PM
Please check post 423, a couple posts back.
-=BFC=-Tekram
06-15-2008, 11:01 AM
Why is RSS Feeds not showing in VBA??? When i set automatic RSS Feeds to Forum ID7 and change it into the gars.php this Article are not showing up??
Can anyone help please?
Morgan
06-16-2008, 04:39 AM
This modification is dated, being made for vB 3.5, probably for vBa CMPS 2.x, and as much of a pain that it poses, the only thing I can suggest is to read through the thread and see if someone posted a solution. Perhaps this (http://www.thevbgeek.com/showpost.php?p=18909&postcount=306) or some other post will help you.
-=BFC=-Tekram
06-17-2008, 05:59 PM
i´ve have this mod running, all the best but the rss news will not show up
fusiongoddess
06-26-2008, 09:25 PM
Yep I upgraded my board to 3.7 as well, and cmps 3.0 and it totally stopped working. I'm gonna try importing the module again, but it doesn't seem like it's going to work. Can anyone update it? This really makes my reviews section lose a lot of traffic, if noone can see the latest reviews added. :(
daisukem
06-26-2008, 09:44 PM
I'll let you know if I find out how.
But it would be nice if someone can share the current module with us. Will be a hero!
Morgan
06-27-2008, 06:11 PM
This modification is dated, being made for vB 3.5, probably for vBa CMPS 2.x, and as much of a pain that it poses, the only thing I can suggest is to read through the thread and see if someone posted a solution. Perhaps this (http://www.thevbgeek.com/showpost.php?p=18909&postcount=306) or some other post will help you.
nuvar
07-29-2008, 02:46 AM
Is anyone's GARS able to work with the latest version of Vbulletin (3.7.2 PL1) ?
I've followed directions from Morgan's post above
Mad_Griffith
08-19-2008, 05:53 PM
do you know how to get the forum name shown in the thread list?
henrikhansen
08-19-2008, 09:28 PM
Is anyone's GARS able to work with the latest version of Vbulletin (3.7.2 PL1) ?
I've followed directions from Morgan's post above
Read post 333
Nordinho
09-12-2008, 02:41 PM
For those interested, to get the module to work in cmps 3.01 change adv_portal_module_shell to adv_portal_module_wrapper on line 105 of the gars.php file.
Nikoo
10-07-2008, 06:06 AM
Hi,
I wonder how and where in the template bit2 should i modify the style of the title, i want to change to bold.(strong)
Thanks.
gothic
10-07-2008, 06:43 AM
Hi,
I wonder how and where in the template bit2 should i modify the style of the title, i want to change to bold.(strong)
Thanks.
The title is lifted from within the gars.php module file (approx line 103)
$mods['title'] = "<a href=\"$bburl/showthread.php?t=$result[threadid]\">$result[title]</a>";
and is sent to the wrapper.
I would think that the title layout is formatted by the theme/style you're using.
Please don't quote me on that, I could be totally wrong.
UPDATE: just played myself changing the above line to
$mods['title'] = "<a href=\"$bburl/showthread.php?t=$result[threadid]\"><bold><i>$result[title]</i></bold></a>";
and it worked a treat, adding bold and italic :D
Nikoo
10-07-2008, 09:25 PM
Thanks a lot. I tested but it don't work whit the modules? :confused:
concreteweb
10-10-2008, 05:03 PM
You can try editing modules/gars.php and change:
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options['bburl'] . substr($result['image'], 1);
}
else
{
$result['image'] = $vbulletin->options['bburl'] . $result['image'];
}
to
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = substr($result['image'], 1);
}
else
{
$result['image'] = $result['image'];
}
You should also be able to do what you want by editing your settings and changing them to $vertical = 0; $limit = 3; and $template = 1;
Thank you very much. *This is what made everything work.
Cocko
11-16-2008, 05:59 PM
Me too ;)
Have a couple of gars.php and modules for cmps.
The last one would not work until above (http://www.thevbgeek.com/showthread.php?p=17101#post17101) changes.
Thanx.
Cocko
11-18-2008, 02:59 PM
Me too ;)
Have a couple of gars.php and modules for cmps.
The last one would not work until above (http://www.thevbgeek.com/showthread.php?p=17101#post17101) changes.
Thanx.
This issue came back with the next new Thread. :(
Image path for uploaded image is
http://www.domain.com/vb3http://www.domain.com/vb3/geek/gars/images/2/2/7/0/2/types/upload_new.jpg
Still searching how to resolve.
Edit:
Now this post (http://www.thevbgeek.com/showpost.php?p=19680&postcount=347) could help.
Need to monitor next actions with uploads and without (=default image)
Chris119
12-03-2008, 12:50 AM
Does anyone have a demo or screenshot to see how this even looks?
Morgan
12-04-2008, 06:12 AM
Don't use vBa products on this site but maybe someone else will link you to one of their webpages.
tazzarkin
01-01-2009, 01:03 AM
For those interested, to get the module to work in cmps 3.01 change adv_portal_module_shell to adv_portal_module_wrapper on line 105 of the gars.php file.
-----------------------------
This is probably the most valuable post in this whole thread.
tazzarkin
01-01-2009, 12:05 PM
well i finally got mines to work, however if someone can just make sure what i did wont mess anything else up:
while ($result = $db->fetch_array($results))
{
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options['bburl'] . substr($result['image'], 1);
}
else
{
$result['image'] = $vbulletin->options['bburl'] . $result['image'];
}
in the last part i took out the $vbulletin->options['bburl'] so it reads the following:
while ($result = $db->fetch_array($results))
{
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options['bburl'] . substr($result['image'], 1);
}
else
{
$result['image'] = $result['image'];
}
-----------------------------------------------
This is the 2nd most valuable thread in this posting.
tazzarkin
01-01-2009, 12:15 PM
After reading every thread and making the recommended chages, here is the gars.php file to work with the newest of everything (vb 3.8 vba 3.1) in 2009.
Merry Christmas and Happy New Year!
<?php
//SETTINGS
$forumids = "10"; // Comma seperated list of forumids
$limit = 5; // How many items to show
$title = "News"; // Module Title
$featured = 0; // 1= Only featured items
$url_to_default_image = "types/3/default.jpg"; //Relative URL to default image from geek/gars/images/ folder
$vertical = 1; // 1= Vertical (only for template 1 or 3)
$preview = 1; // 1= Show preview
$ratings = 0; // 1=show ratings
$template = 2; // 1=simple with pic, 2=big with pic, 3=Listing no pic
$order = 1; // 0 = rand, 1=desc, 2=asc
$maxchars = 400; // Maximum amount of chards to snip
$customfields = false; // Set to true to grab the custom fields.
$parsebb = true; //set to true to parse preview
// END SETTINGS
switch ($order)
{
case 0:
$order = "RAND()"; break;
case 1:
$order = "g.threadid DESC"; break;
default:
$order = "g.threadid ASC";
}
if (!$limit)
{
$limit = "1";
}
$sql = "SELECT g.threadid,g.header_image image, p.title, g.byline, t.forumid, t.dateline, t.postuserid, t.postusername " .
($preview ? ", IF(g.synopsis, g.synopsis, p.pagetext) synopsis " : "") .
($ratings ? ",round((g.overall_rating/10),0) author_rating, g.overall_rating author_rating_percent,round((g.avg_rating/10),0) member_rating, g.avg_rating member_rating_percent " : "" ) .
",g.pagecount, g.custom2 " . ($customfields ? ",gcv.*" : "") . " FROM
" . TABLE_PREFIX . "gars g
" . ($customfields ? " INNER JOIN " . TABLE_PREFIX . "gars_custom_values gcv ON gcv.custom_threadid = g.threadid " : "") . "
INNER JOIN " . TABLE_PREFIX . "thread t ON g.threadid = t.threadid
INNER JOIN " . TABLE_PREFIX . "post p ON t.firstpostid = p.postid
WHERE t.visible = 1 AND t.open != 10
" . ($forumids ? " AND t.forumid in ($forumids) " : "" ) . "
" . ($featured ? " AND g.feature_untill> " . TIMENOW : "") . "
ORDER BY $order LIMIT $limit";
$results = $db->query_read($sql);
$modulehtml = "";
$x = 0;
$bburl = $vbulletin->options['bburl'];
if ($template==2)
{
$vertical = 1;
}
$mods['colspan'] = ($template==2 ? 3 : $x);
$mods['collapse'] = $mods['modid'];
$modcollapse = $vbcollapse["collapseobj_module_" . $mods['modid'] . ""];
$modimgcollapse = $vbcollapse["collapseimg_module_" . $mods['modid'] . ""];
while ($result = $db->fetch_array($results))
{
if (!$result['image'])
{
$result['image'] = $vbulletin->options['bburl'] . "/geek/gars/images/" . $url_to_default_image;
}
elseif (substr($result['image'], 0, 1) == ".")
{
$result['image'] = $vbulletin->options['bburl'] . substr($result['image'], 1);
}
else
{
$result['image'] = $result['image'];
}
if ($parsebb && $template!=3)
{
$result['message'] = $bbcode_parser->do_parse($result['synopsis'], 0, 1, 1, 1);
}
else
{
$result['message'] = strip_bbcode($result['synopsis']);
}
if (strlen($result['message']) > $maxchars)
{
$result['message'] = substr($result['message'], 0, strrpos(substr($result['message'], 0, $maxchars), ' ')) . '...' . ($template!=3 ? construct_phrase($vbphrase['read_more'], $vbulletin->options['bburl'], $result['threadid'], $session['sessionurl']) : "");
}
$result['dateposted'] = vbdate($vbulletin->options['dateformat'], $result['dateline']);
eval('$bits = "' . fetch_template('adv_portal_gars_bit' . $template) . '";');
if ($vertical && ($template != 2))
{
$modulehtml .= "<tr>$bits</tr>";
}
elseif ($vertical && $template == 2)
{
$mods['title'] = "<a href=\"$bburl/showthread.php?t=$result[threadid]\">$result[title]</a>";
$modulehtml = $bits;
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_module_wrapper') . '";');
}
else
{
$modulehtml .= $bits;
$x++;
}
}
if ($modulehtml && ($template != 2))
{
if (!$vertical)
{
$modulehtml = "<tr>$modulehtml</tr>";
}
$home[$mods['modid']]['content'] .= $modulehtml;
}
elseif ($modulehtml && $template == 2)
{
$mods['noshell'] = true;
}
?>
tazzarkin
01-01-2009, 12:24 PM
The title is lifted from within the gars.php module file (approx line 103)
$mods['title'] = "<a href=\"$bburl/showthread.php?t=$result[threadid]\">$result[title]</a>";
and is sent to the wrapper.
I would think that the title layout is formatted by the theme/style you're using.
Please don't quote me on that, I could be totally wrong.
UPDATE: just played myself changing the above line to
$mods['title'] = "<a href=\"$bburl/showthread.php?t=$result[threadid]\"><bold><i>$result[title]</i></bold></a>";
and it worked a treat, adding bold and italic :D
-----------------------------------
Maybe the 4th best thread. Thank you for this.
NoDRaC
04-05-2009, 09:19 PM
i have another portal system. But i want to ask how can i use gars.php non vb-pages to show resutl?
Morgan
04-06-2009, 03:46 PM
That would require a customized script. There are a number of examples (http://www.google.com/search?q=site:.vbulletin.org+non+vb+page) on vBorg for how to create a non vB page while using the vB authentication if that's the route you want to take.
Arjan
04-11-2009, 01:17 PM
I got this working and it does do most things I want.
I've only got one problem: Attachments which are inserted into the text are only shown as a link.
Can anyone tell me how I can get it to show the image itself?
For starters I found that gars.php is lacking the code to retreive the attachment. I have no clue how to add this, unfortunately.
Arjan
04-11-2009, 02:24 PM
A version that shows the synopsis instead of the message body would also be welcome. Maybe selectable in the settings?
In that case I can display a short message on the frontpage with a link to the full message.
gothic
05-21-2009, 07:21 AM
Just upgraded to vBAdvanced 3.2.0 and the module stopped functioning.
Am using a standard vB 3.7.3 installation and upgraded from an UN-MODIFIED vBA 3.1.0 which had the GARS block working beautifully.
Picked it all apart and tried various config changes but no mustard :(
Simply can't get the little begga to work.
Any suggestions?
Morgan
05-23-2009, 03:34 PM
Not sure, does vBa have a setting where you can enter variables from this add-on to globalize?
Neutral Singh
06-03-2009, 07:18 PM
Hi
I dont know what is causing this in Internet Explorer 8.
My settings are in gars.php:
//SETTINGS
$forumids = "324,323,322,321,319,12,19,20,27,55,6,75,83,297,295 ,292,290,14,22,23,25,39,54,73,74,217,20,293,297,29 6,318,50,302,309,303,304,305,306,307,308,314,317,3 18,316,320,289,214,210,237,27"; // Comma seperated list of forumids
$limit = 5; // How many items to show
$title = "News Articles"; // Module Title
$featured = 0; // 1= Only featured items
$url_to_default_image = "types/3/default.jpg"; //Relative URL to default image from geek/gars/images/ folder
$vertical = 0; // 1= Vertical (only for template 1 or 3)
$preview = 0; // 1= Show preview
$ratings = 0; // 1= show ratings
$template = 1; // 1= simple with pic, 2=big with pic, 3=Listing no pic
$order = 1; // 0= rand, 1=desc, 2=asc
$maxchars = 200; // Maximum amount of chards to snip
$customfields = false; // Set to true to grab the custom fields.
$parsebb = true; //set to true to parse preview
// END SETTINGS
adv_portal_gars_bit1 template has the following code.
<if condition="$vertical"><tr></if>
<td class="alt2" align="center" valign="top">
<img alt="$result[title]" src="$result[image]" style="border: 2px #000000;padding:2px;" /><br />
<a href="$bburl/showthread.php?t=$result[threadid]" title="$result[title]">
<strong>$result[title]</strong></a><div class="smallfont">$result[byline]</div>
</td>
<if condition="$vertical"></tr></if>
In vba CMPS module, i have set the colspan = 5, but if you look at my website in internet explorer, i am getting incorrect display.
What is wrong? and how can i correct it.?
Thanks
Morgan
06-09-2009, 01:28 PM
Five thumbnails, but Latest News "in" one thumbnail. Looks like you need to make use of colspan="5" in the TD tag for the Latest News to allow it to go across the five thumbnails.
e36freak
06-14-2009, 03:57 PM
Hello all,
is there a change to get running this module in the gars forumdisplay?
It would be great to have it. Could somebody help me please?
Thank you.
Regards,
Markus
Morgan
06-15-2009, 04:39 PM
Sorry I don't use vBa CMPS but maybe someone who has done what you seek will come by and offer input.
e36freak
06-16-2009, 10:45 AM
Hm, OK, it should look like this:
http://www.e46fanatics.de/showroom/
I want to have the left an the right column with the pictures in it. It's the same like the vba cmps gars block, but i would need it for gars itself.
No chance?
Morgan
06-22-2009, 04:04 PM
Not sure what they are using to create that but one idea would be to use the top module that comes with GARS to produce blocks like on this (http://www.thevbgeek.com/forumdisplay.php?f=12) page and edit the top module to also display thumbnails.
stylez84
07-03-2009, 03:05 AM
Just a heads up...
I was getting an error "Content Encoding Error" in Firefox when loading my vBA home page, and I fixed this error by disabling gzip compression under "Cookies and HTTP Header Options" under the main vBulletin settings.
Not sure if there is another way around this or not. Other than that little snafu this works great with the updated PHP file a couple pages back.
JohnBee
06-22-2010, 12:09 PM
I wish someone would update this module so as to not misslead people into buying a license with the intent of using it with vB and vBadvanced. The module doesn't work with v3.8x and vB4 so don't waist your time.
gothic
06-22-2010, 01:32 PM
I wish someone would update this module so as to not misslead people into buying a license with the intent of using it with vB and vBadvanced. The module doesn't work with v3.8x and vB4 so don't waist your time.
It is fully recognised that GARS itself has not been upgraded to vB4 yet, a decision is pending.
As for working with vB3.8.x it works perfectly, I have it running on a couple of my sites quite satisfactorily.
JohnBee
06-22-2010, 02:02 PM
It is fully recognised that GARS itself has not been upgraded to vB4 yet, a decision is pending.
As for working with vB3.8.x it works perfectly, I have it running on a couple of my sites quite satisfactorily.
Hmmm, I just tested it with a fresh copy of vBa 3.2.2 and vB 3.8.4 and all I'm getting are module titles out of it(no content). I'm assuming the MOD doesn't work out of the box.
UPDATE...
Okay I copy and pasted some code(later in this thread), then mucked around the settings... "would been nice to indicate to check (Initialize BB Code Parser)" prior to toggling the module.
Anyways... long story short, I got it echo'ing articles.
So I guess it works.
Any chance someone could clean this thread up to help others walk the straight and narrow? I really like GARS, but I could see alot of people walking away from this based on the feeling that the module and addon are no longer being maintained(pitty).
Thanks for a great HACK btw.
~JB
Morgan
06-24-2010, 07:21 PM
Unfortunately no one has yet submitted a new mod for this here: http://www.thevbgeek.com/forumdisplay.php?f=16
gothic
06-27-2010, 08:13 AM
Any chance someone could clean this thread up to help others walk the straight and narrow? I really like GARS, but I could see alot of people walking away from this based on the feeling that the module and addon are no longer being maintained(pitty).
~JB
Give me forty eight hours and I'll gather all snippets and latest information then create a new thread.
I'm in the middle of upgrading one of my sites from vB 4.0.3(alpha) to vB 3.8.x stable :rolleyes: so when that's completed I'll get to this.
Check out THIS post for an updated version (http://www.thevbgeek.com/showthread.php?t=5674)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.