vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Add-On Releases - AJAX Tabs Content Script v2 (https://vborg.vbsupport.ru/showthread.php?t=161197)

bobster65 11-27-2007 11:34 PM

Quote:

Originally Posted by Mr. Boo (Post 1390682)
I got it thanks, I had the old tabs_block_main template. Changed that and its working fine again now :) Thanks for your help :)

No Problem... when you get time, click install ;) :cool:

ZiG 11-29-2007 11:45 PM

hey, im not excellent at hard coding PHP so could I get a little bit of assistance in preparing a tabexternal.php for a specific GARs module I am trying to put together to work with this script. basically what this module does is pull the latest defined amount of stories you want pulled from a specific GARs forum, and displays it similarly to how recent threads are displayed in the recent thread tabexternal.php. the only difference is that there is a GARs header_image that is pulled, and also a byline that are taken from different sql tables (gars g sql tables, not thread tables). if any of you use GARs, you should have an idea of what i'm talking about.

here is the GARs module code i am trying to plug into your ajax tabs script:

Code:

<?php

        //SETTINGS

    $forumids = "20";                  //      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'] = $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']);

        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_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;
    }


?>

This is actually a CMPS module file, intended to be used with vBa CMPS, plugged in via the CMPS module system. you can find the actual module file and more information on the module here:

http://www.thevbgeek.com/showthread.php?t=1439

You can see the module running right on my webpage, underneath the News & Press Releases block, over at:

http://www.ready-up.com

Please help me to get this module running within the ajax tabs, I think it would be a great addition to this script as a lot of people use GARs. I tried myself to get it working, and I will continue trying on my own but like I've said i'm not so great at hardcoding PHP so i'm posting here in hope of getting a little bit of assistance. if i do happen to get this working, i will post the tabexternal php files for everyone else to use.

thanks in advance to anyone who helps out

glorify 11-30-2007 01:02 AM

Don't have experience with Gars. Your site rocks btw :)

ZiG 11-30-2007 01:48 AM

thanks man, so does yours

------------------------------

**UPDATE

I actually got it working on my own i'll post the files soon...you can see it running on my site right now for the news articles. im going to try to make one for the gallery also...

Maddogz420 01-03-2008 11:20 PM

Had a problem, fixed it. Just misread the instructions..


Great hack, installed!


Okay, now we have this...

Quote:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/vba_cmps_include_template.php on line 47
http://www.mischiefsociety.com/vb/cm...e=testhomepage


But it doesnt matter, im using html pages anyways....

bobster65 01-03-2008 11:29 PM

Quote:

Originally Posted by Maddogz420 (Post 1414995)
http://www.mischiefsociety.com/vb/cm...e=testhomepage

Having some trouble with this... Ive gone thru the instructions a thousand times now and just gotta ask... how'd i fudge this one up?

I've seen this issue before (you are not the first).... trying to remember exactly what the cause was... I know its something simple..... I'm sure I will remember what the solution is in a few and THIS time I will write it down and add it to the troubleshooting guide lol.. sorry that you are having problems installing it.. we'll get ya hooked up even if I have to take a closer look at your setup.

Thanks.. Bob

EDIT: Remembered what it was... incorrect path to either the CSS or JS file or forgot to do the first few procedures in Step 5 of the instructions..

bobster65 01-03-2008 11:37 PM

Quote:

Originally Posted by Maddogz420 (Post 1414995)
Had a problem, fixed it. Just misread the instructions..

Great hack, installed!

Okay, now we have this...

http://www.mischiefsociety.com/vb/cm...e=testhomepage

Just remark that include out in the content files

Maddogz420 01-03-2008 11:51 PM

Thanks, on second thought ill be trying to get one of your php pages you packaged working.. I see you caught all my post edits, didnt think the response would be so quick !

Killer mod dude!

What i did originally was made a template page, instead of making a module then adding it to a page... doh!

bobster65 01-04-2008 12:06 AM

Quote:

Originally Posted by Maddogz420 (Post 1415010)
Thanks, on second thought ill be trying to get one of your php pages you packaged working.. I see you caught all my post edits, didnt think the response would be so quick !

Killer mod dude!

What i did originally was made a template page, instead of making a module then adding it to a page... doh!

Cool Beans... I just happened to be online when you posted :D ... and ya, just remove that include in any of the "content" files that craps out on ya.. everything else will run just fine.

Maddogz420 01-04-2008 12:23 AM

Heres a live demo if you need one (or another)

http://www.mischiefsociety.com/vb/cmps_index.php

Smecksie stuff =)


All times are GMT. The time now is 03:20 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01334 seconds
  • Memory Usage 1,788KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete