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 02-07-2008 06:56 PM

Quote:

Originally Posted by stonner (Post 1438384)
Hi

I tried to add a tab with the newest profile photos. But it shows this error:

Parse error: syntax error, unexpected '<' in /home/stonner/public_html/forums/tabexternal4.php on line 42

Could you please help me?

I attached my file tabexternal4.php.

Thank you very much

That error is because you need to echo out HTML in the file.. after looking at what you are trying to do, I think that the iframe option would be the best (since you are calling external javascript) .. I don't have any iframe stuff that you could look at that would help, so I would suggest going to dynamic drive and reading the section on iframes for AJAX Tabs 2 .. I'll do some digging when I have some spare time.. just have not played with that option yet (but know that its the best for what you are attempting)..

bobster65 02-07-2008 09:46 PM

*Update* added two new sample content files for use with this addon as well as a sample make your own file (Replicate the vBa UserCP Block)

The FILES for these are located in Post 3 of this Thread.

NEW 02-07-2008 - tabrecentthreadsexp2.php - This file includes Post ICON Column and the ability to set a specific Thread Title Character cut off amount.

NEW 02-07-2008 - tab_blog.php - This content file is for use with vbulletins blog system. It is a BASIC recent blogs layout. The File contains 2 Layout Styles (Wide and Small). Wide is the default. To use small (for skinny Tab Layouts) remark out the 2 Wide Layout Areas and uncomment out the 2 ALT Layout Areas. Both display Title, Name, Data and Views.

What to make your own?
Check out Post 3 of this thread to see an example of replicating the USER CP BLOCK.

ZiG 02-07-2008 11:10 PM

I apologize, I said I would post up the GARs tab that I completed and I completely forgot. For those of you using GARs for articles on your vBulletin forums, if you would like to display the latest recent GARs articles within an Ajax TAB you can do so with the following .php file:

Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'tabrecentthreadsexp'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(
);

// get special data templates from the datastore
$specialtemplates = array(
);

// pre-cache templates used by all actions
$globaltemplates = array(
);

// pre-cache templates used by specific actions
$actiontemplates = array(
);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
//require_once('./includes/vba_cmps_include_template.php');
require_once('./includes/vba_cmps_global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

?>

<?php

echo '<table border="0" cellpadding="0" cellspacing="0" width=100%><tr>';


$modulehtml = "";
$x = 0;
$bburl = $vbulletin->options['bburl'];
$forumids = "";                  //      Comma seperated list of forumids
$limit = 4;                        //      How many items to show
$title = "";                        //        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 = 150;                    //  Maximum amount of chards to snip
$customfields = false;                // Set to true to grab the custom fields.
$parsebb = true;                        //set to true to parse preview

switch ($order)
    {
        case 0:
                $order = "RAND()"; break;
        case 1:
                $order = "g.threadid DESC"; break;
        default:
                $order = "g.threadid ASC";
    }
    if (!$limit)
    {
        $limit = "1";
    }

// COMMENTED OUT FOR TESTING
        ($hook = vBulletinHook::fetch_hook('vba_cmps_module_recthreads_start')) ? eval($hook) : false;

// Main SQL   

                $results = $db->query_read("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 : "") . "

            ORDER BY $order LIMIT $limit");

                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'] = 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']) : "");

                      }
                     
                      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']) : "");

                      }

                      eval('$bits = "' . fetch_template('adv_portal_gars_bit' . $template) . '";');

                      echo '<tr>'  .  $bits  .  '</tr>';
                }

echo "</table>";


?>

Basically, I just took the GARs vB CMPS module file and merged it with the recent threads tab file that came with this Ajax TABS script (I think thats what I did? It's been a little while so I kind of forgot. :rolleyes:)

I hope this helps anyone using GARs and the Ajax TABs script. You can see this running live at my website (www.ready-up.com). There is currently a small bug in firefox with my nested tabs, just hit the "Home" link on the top of the page if you are using firefox and you should be able to see the tabs working perfectly after that. PM me if you have any questions or problems setting that up.

Thanks again bob, wonderful script! :cool:

bobster65 02-08-2008 04:57 PM

Quote:

Originally Posted by ttnb
Hello
Thanks for your help!
what I want is to put is based on this hack

http://www.vbadvanced.com/forum/showthread.php?t=18416

I want to dis play new or random links from links directory. The ways is like this
------------------------------------------
-Link name --Category name
-Link name2- category name 2
-link name 3- category name 3
------------------------------------------
And if the name of link is too long it is automatically cut of(for not break my page).

Sorry but I would like to post here instead of PM you because I want other members who are interested in share idea.

OK.. this was pretty simple actually and I made you two different styles (basic and expanded) .. The Basic one is just as you described above. The Expanded one includes the Link Name, Author, Date, Time, Category, # of Replies and # of Views.

Each file comes with various configuration settings to meet your needs/requirements.. ie

$linkurl Variable (The full URL Path to your vba links directory)

$order Variable can be set as follows (1 = newest, 2 = most viewed, 3 = most comments, 4 = highest rated, 5 = random) to give you 5 different ways of displaying your data for your members.

$limit Variable can be set to the number of links you would like to display

$maxnamechars Variable used to set the max characters of the links name before the rest will be replaced with '...' NOTE: Set this to 0 to disable it.

Both files contain the same basic code, just different echo output to control the Layout for the Data.

To further customize the layout, look for the echo statements and edit the HTML output.. simple as that :cool:

duncan99 02-18-2008 11:05 AM

https://vborg.vbsupport.ru/external/2008/02/17.jpg

This is an mazing hack I have ever seen, thank you for your time to code.

I have a little request, I just want to make a simple tab category for different categories in a forum like the picture shown, say I click on announcement tab it only pulls out the threads about announcement, click on recent NFL news it shows only thoses threads of NFL news. Can somone show me how, the more I read on the post the more I confuse...

Thank you in advance...

bobster65 02-18-2008 12:34 PM

Quote:

Originally Posted by duncan99 (Post 1445820)
https://vborg.vbsupport.ru/attachmen...5&d=1193424613

This is an mazing hack I have ever seen, thank you for your time to code.

I have a little request, I just want to make a simple tab category for different categories in a forum like the picture shown, say I click on announcement tab it only pulls out the threads about announcement, click on recent NFL news it shows only thoses threads of NFL news. Can somone show me how, the more I read on the post the more I confuse...

Thank you in advance...

Well, you will need to make 4 .php files (use the recentthreads example file and make 3 additional copies of it). Then, edit each file to contain only the forum ID you wish. Upload those new files, then edit the template, change the tab names to what ever you want and point each tab to the specific file.

ericgtr 02-18-2008 04:26 PM

bobster, I just wanted to say thanks for all of your work on this. Your support is nothing less than superb and you deserve a lot of credit. I installed it on my site this morning and it's working great!

bobster65 02-18-2008 04:40 PM

Quote:

Originally Posted by ericgtr (Post 1446031)
bobster, I just wanted to say thanks for all of your work on this. Your support is nothing less than superb and you deserve a lot of credit. I installed it on my site this morning and it's working great!

You are more than welcome Eric. If you have any questions, feel free to PM me anytime.

barroca 02-22-2008 01:53 PM

hello bobster,

first: a hudge thank you for this work :)

I see in dynamic drive page a new js version. We can update in our installs?
The new version have a interesting feature [forward/reward] tabs

All the best
Joao Barroca
aka beduino

bobster65 02-22-2008 02:06 PM

Quote:

Originally Posted by barroca (Post 1448694)
hello bobster,

first: a hudge thank you for this work :)

I see in dynamic drive page a new js version. We can update in our installs?
The new version have a interesting feature [forward/reward] tabs

All the best
Joao Barroca
aka beduino

I was just there yesterday and didn't see it lol .. Im sure you can upgrade without any problems.. might have to change a few things in the template, but thats about it (besides uploading the new .js file) ..

I'll check things out :up:

EDIT: OK, checked it out. Nothing major, just a .(dot) release. All you need to do is upload the new .js and you can use the forward/back feature. When I get time, I will update posts 1-3 with the new available info. Thanks for the heads up bud!


All times are GMT. The time now is 07:37 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.01162 seconds
  • Memory Usage 1,796KB
  • 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