vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > Add-On Modules & Modifications > vBa CMPS v3.x & 2.x > Add-On Modules (version 3.x & 2.x)

Reply
 
Thread Tools Display Modes
  #1  
Old 10-26-2007, 03:35 PM
bobster65 bobster65 is offline
Senior Member
 
Join Date: Mar 2006
Posts: 587
Default AJAX Tabs Content Script v2.0 enhanced

*** NOTICE ***

This Modification has been UPGRADED to a NEW Release

AJAX Tabs Content Script - Version 3.0 (YUI)

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

The NEW Version supports all previous Content Files, so switching over will not be an issue.

ALL PREVIOUS VERSIONS ARE NOW UNSUPPORTED. IF YOU WANT/NEED SUPPORT, YOU MUST UPGRADE TO THE LATEST VERSION.

NOTE: If there is someone interested in taking over support for these older versions, feel free to contact me so we can work something out.


AJAX Tabs Content Script - Version 2.0 enhanced

Note: Altho this "How To" is written for implementation within vbadvanced CMPS, this can also be easily implemented anywhere within vB , ie on custom vB pages or within current vB pages.

Description/Whats changed within this enhanced release?: This new version (based on the AJAX Tabs Content Script (v 2.0) written by Dynamic Drive - http://www.dynamicdrive.com/dynamici...tent/index.htm) is a versatile Ajax script that lets you display content pulled from external files inside a DIV and organized via CSS tabs. A fully unobtrusive, CSS and HTML based script, it supports practical features such as persistence of the active tab (ie: when page is reloaded), an "IFRAME" mode, a "slideshow" mode, ability to expand/contract arbitrary DIVs on the page at the same time, nested tabs, and much more. Below lists the features of this script that together make it highly adaptable in the real world:

Here's a quick outline of the script features:
  • Fetch and display an external page (from the same domain) inside a container when a tab is clicked on via Ajax.
  • (v 2.0) Apart from Ajax, an external page can also be fetched and displayed via the IFRAME element instead. This is useful for external pages that either contain JavaScript/ CSS code that doesn't run properly when fetched via Ajax, or the page is from an outside domain.
  • Add a "default" content inside the container to either be shown while no tabs are selected, or to be associated with a specific tab. The default content is added inline on the page and not fetched via Ajax, to avoid unnecessary fetching of external pages.
  • Supports session only persistence, so the last tab user clicked on is remembered if he/she returns to the page within the same browser session.
  • (v 2.0) Supports auto "slideshow" mode, in which script automatically cycles through and selects each tab periodically until a tab is explicitly selected.
  • (v 2.0) Ability to also expand/contract arbitrary DIVs on the page as the tabbed content is expanded/ contracted.
  • (v 2.0) Ability to dynamically select a tab either based on its position within its peers, or its ID attribute.
  • (v 2.0) Ability to directly load a different external page into the content container, either via Ajax or IFRAME.
  • (v 2.0) Ability to set where the CSS class "selected" get assigned when a tab is clicked on- either on the tab link itself (its "a" element), or its parent instead (ie: "li" element). This makes the script adaptable to both CSS Tabs that are styled at the "A" level itself, or its parent container instead.
  • (v 2.0) Supports nested Ajax Tabs! In other words, you can have an external page fetched via Ajax contain in itself Ajax Tabs that show their own contents when clicked on as well. This is made possible using the "onajaxpageload" custom event handler (see documentation).
  • Supports multiple Ajax Tabs Contents on the same page.
  • Fully unobtrusive, search engine friendly design. For search engines or browsers with JavaScript disabled, the external contents will just load as actual pages (instead of via Ajax).

Reminder: Due to security limitations, the external pages loaded via each tab using Ajax must reside on the same domain as the script itself. This limitation doesn't apply if you use the "IFRAME" option to fetch and show the external page instead.

This is what I've done so far to implement AJAX Tabs functionality for my websites and others. I hope that its easy to follow along, answers your questions and meets your needs. If you are reading this and wondering what a tabbed content is, check out the screen shots for a visual.

CMPS Version Note: Coded for CMPS v3.0. Modifications can be made to the php files (Require Back-End) to work with CMPS v2.x

CMPS Module Type: TEMPLATE w/Alternative Module Wrapper Template
Templates: adv_portal_Tab_Block_Main, adv_portal_alt_module_wrapper (optional)
Files: ajaxtabs.js, ajaxtabs.css, Sample Content Files, images

Note: I've included sample files in the attached Zip File to use with the step by step how to.

Step 1. Upload the ajaxtabs directory (located in the attached Zip File) to the FORUMS Root.
This directory contains the ajaxtabs.js file & the ajaxtabs.css file
path example: /www/forums/ajaxtabs/ajaxtabs.js


Step 2. Modify CSS file.
Use Attached Sample CSS file - Sample name: ajaxtabs.css
Change paths to images to reflect your domain and forum root (2 lines)...

Note: Additional Modifications to this file can be made once you get the initial sample system up and running.


Step 3. Create, Name and Upload Multiple "Content" files.
Use attached Sample PHP "Content" file - Sample name: tabexternal.php (I've included working samples in the attached Zip File).

NOTE: Please read the Instructions TXT File for the edits that need to be made in order for them to work on your site.

The location I chose for these was the FORUMS root.
path example: /www/forums
You can name these files anything you want. For example, I chose a naming convention - tabexternal.htm, tabexternal2.php, tabrecentnews.php, tabvbookie.php, ..etc etc

Note: Further Modifications to these files can be made once you get the initial system up and running.


Step 4. (optional) Create an Alternative Module Wrapper Template.
Use attached Sample Alternative Module Wrapper Template - Sample name: adv_portal_alt_module_wrapper

I chose to do this, because I didn't want to use the standard Module Wrapper that comes default with vBadvanced.

NOTE: Use the default wrapper if you choose not to create your own custom one.


Step 5. Create a new Template.
Use attached sample Custom Template Sample name: adv_portal_Tab_Block_Main

This template will be the one that you include with the module that you will create in Step 6. I've included the code for the sample template in the attached file, HOWEVER, there are some edits that you will need to make to the code based upon steps 1-3 above.

EDITS NEEDED TO THE ATTACHED SAMPLE TEMPLATE:

EDIT 1 - Path location of the ajaxtabs.css file created in step 2. Simply edit this line in the template to the correct path.
Code:
<link rel="stylesheet" type="text/css" href="/forums/ajaxtabs/ajaxtabs.css" />
EDIT 2 - Path location of the ajaxtabs.js file in step 1. Simply edit this line in the template to the correct path where you uploaded the ajaxtabs.js file.
Code:
<script type="text/javascript" src="/forums/ajaxtabs/ajaxtabs.js">
EDIT 3 - Path location of the "Content" file(s) created in step 3. Simply edit the line(s) in the template to the correct path where you uploaded the PHP file(s).
Code:
<li class="selected"><a href="http://www.domain.com/forums/tabexternal.php" rel="ajaxcontentarea">Tab 1</a></li>
<li><a href="http://www.domain.com/forums/tabexternal2.php" rel="ajaxcontentarea">Tab 2</a></li>
<li><a href="http://www.domain.com/forums/tabexternal3.php" rel="ajaxcontentarea">Tab 3</a></li>
<li><a href="http://www.domain.com/forums/tabexternal4.php" rel="ajaxcontentarea">Tab 4</a></li>

Step 6. Create a new CMPS TEMPLATE Module.
Name it what ever you like. Include the template that you created in Step 5 above. Make sure that you either use the Module Wrapper Template OR the Alternative Module Wrapper Template that you created in optional Step 4 above. Give permission(s) to the user groups that you want to be able to view this.


Step 7. Add the Module to a CMPS page.
Add the module created in Step 6 above to any CMPS page (make a test page if you want to)...


Step 8. Load the CMPS page that you added the module to.
If you performed the above steps correctly, the result will be a tabbed block module with 4 tabs named Tab 1, Tab 2, Tab 3, Tab 4. The content for Tab 1 will say "Congrats USERNAME! You have successfully added AJAX Tab Content to your Site."


CUSTOMIZATION

Style: Modify CSS File in Step 2 to match the Style of your site. The Sample CSS Files comes with 3 different styles of Tab Layouts. Choose the one that best suits your needs and further modify the CSS to match your sites Style(s)....

Tab Names: Modify Template created in Step 5 to change the NAME of the tabs themselves - ie.. from Tab 1 to Announcements (see below)

Code:
<li><a href="http://www.domain.com/forums/tabexternal.php" rel="ajaxcontentarea">Announcements</a></li>

Content: Modify "Content" File(s) created in Step 3 to generate content. You can add static content or Dynamic Content. Below is a very very basic sample of what can be done.

Sample mix of static and dynamic content
PHP Code:
<?php

echo '<table cellspacing="2" cellpadding="0" width=100%><tr> <td class="alt2"><span class="smallfont">Welcome Back To YOURSITENAMEHERE&nbsp;<b>' $vbulletin->userinfo['username'] . '!</b><br><br>Hope you are enjoying the off season so far.<br><br> The Draft, Mini Camps & Hall of Fame Weekend Events are complete, Train Camps are in full swing and Preseason Games have started to kick off!<br><br>
Im sure these next few weeks will be fun to follow and make the upcoming season even more exciting. <br><br>Good luck with your team&nbsp;<b>' 
.  $vbulletin->userinfo['username'] . '.</b></span></td></tr>';

?>
NOTE: You can get as creative as you want to with content (Both static and Dynamic). For example, I took code from the recentthreads.php file, modified it and included that as tabbed content to display recent threads within a tab on my site (as seen in the screen shots attached in Post 1 of this thread). (I've included samples with instructions of this within the zip file. Side Note: use/modify these samples at your own risk)


Turning on "slideshow" mode

You can have the tabs within your Ajax Tabs Content automatically rotate every x seconds until a user explicitly clicks on a tab. To enable "slideshow" mode on your Tab Content, just pass in an integer when calling instance.init() to initialize your script: This is located at the bottom of the Template you created in step 5

Code:
<script type="text/javascript">
var mytabs=new ddajaxtabs("maintab", "ajaxcontentarea")
mytabs.setpersist(true)
mytabs.setselectedClassTarget("link") //"link" or "linkparent"
mytabs.init(15000)
</script>
</body>
</td></tr>
Notice the integer in red, which is in units of milliseconds. With one defined, the script will rotate through the tabs every x milliseconds (so 15000=15 seconds).


ADDING MORE TABS

To add more tabs, you will need to modify the template created in Step 5 and create a new "content" file for each new tab (as explained in Step 3).

Step 1. Add the following line of code to the Template that you created in Step 5 for each new Tab that you want to appear. Its a good idea when you add the lines that you keep them in order with the other lines currently in the file.

Code:
<li><a href="http://www.domain.com/forums/CONTENT FILE" rel="ajaxcontentarea">TAB NAME</a></li>
Example:
Code:
<li><a href="http://www.domain.com/forums/tabcontent5.php" rel="ajaxcontentarea">Sports News</a></li>
Step 2. Upload the newly created "Content" file (as explained in Step 3) to your FORUMS root.


Additional Enhancements and Content Files

Please see posts 2&3 of this thread for additional enhancements. Members are encourage to provide their custom content file for inclusion in Post 3.

If you want to read up on AJAX Tabs, check out the Ajax Tabs Content script over at Dynamic Drive (http://www.dynamicdrive.com/dynamici...tent/index.htm)

....thats it in a nutshell.... I do hope that I explained things well enough to at least get a head start on AJAX Tabbed Content. Let me know if you have any problems or need further explanation on anything...

Thanks and enjoy Bobster

Screen Shots Explained:

The 1st is an example of "Slideshow" Mode * New Feature
The 2nd is an example of some dynamic content based on the user.
The 3rd is an example of modified recentthreads.php used within a tab.
Attached Images
File Type: gif tab-slide.gif (32.9 KB, 2892 views)
File Type: jpg tab1.jpg (149.2 KB, 2682 views)
File Type: jpg tab2.jpg (196.5 KB, 2693 views)
Attached Files
File Type: zip AJAX Tabbed Content.zip (21.6 KB, 1097 views)

Last edited by bobster65; 09-17-2008 at 09:48 AM.
Reply With Quote
  #2  
Old 10-26-2007, 03:35 PM
bobster65 bobster65 is offline
Senior Member
 
Join Date: Mar 2006
Posts: 587
Default Re: AJAX Tabs Content Script v2.0 enhanced

Additional Enhancements

** Coming Soon ** (Adding on the fly lol)

Different Tab Layout Styles

The attached CSS file contains CSS for 3 different layout styles. To change the inverted style that is preset with the sample, edit the adv_portal_TAB_BLOCK_MAIN template (or what ever you named it) to one of the below samples.. both samples below have the tabs on the top.

This layout is for the shadetabs CSS

Code:
<ul id="tabs" class="shadetabs">
<li><a href="tabexternal.php" rel="tabcontainer" class="selected">Tab 1</a></li>
<li><a href="tabexternal2.php" rel="tabcontainer">Tab 2</a></li>
<li><a href="tabexternal3.php" rel="tabcontainer">Tab 3</a></li>
<li><a href="tabexternal4.php" rel="tabcontainer">Tab 4</a></li>
</ul>

<div id="divcontainer" style="border:1px solid gray; width:450px; margin-bottom: 1em; padding: 10px">
</div>

<script type="text/javascript">

var mytabs=new ddajaxtabs("tabs", "divcontainer")
mytabs.setpersist(true)
mytabs.setselectedClassTarget("link") //"link" or "linkparent"
mytabs.init()

</script>
This layout is for the indentmenu CSS

Code:
<div id="tabs" class="indentmenu">
<ul>
<li><a href="tabexternal.php" rel="tabcontainer" class="selected">Tab 1</a></li>
<li><a href="tabexternal2.php" rel="tabcontainer">Tab 2</a></li>
<li><a href="tabexternal3.php" rel="tabcontainer">Tab 3</a></li>
<li><a href="tabexternal4.php" rel="tabcontainer">Tab 4</a></li>
</ul>
<br style="clear: left" />
</div>

<div id="divcontainer" style="border:1px solid gray; width:550px; height: 150px; padding: 5px; margin-bottom:1em">
</div>


<script type="text/javascript">

var mytabs=new ddajaxtabs("tabs", "divcontainer")
mytabs.setpersist(false)
mytabs.setselectedClassTarget("link")
mytabs.init()


</script>

Dynamically selecting a tab anywhere on your page

After your Ajax Tab script is initialized and displayed, you can dynamically select any of its tabs either based the tab's position relative to its peers, or its ID attribute (you have to assign it one first). The method to call is the following:

Code:
instance.expandit(tabid_or_position)
The parameter entered should either a string representing the tab link's ID attribute (you need to first assign one to that tab), or an integer corresponding to that tab's position relative to its peers, to select. For the later, the counting starts at 0 (ie: 0=1st tab). For example:

Code:
<p><a href="javascript: countries.expandit(2)">Select 3rd Tab</a></p>
<p><a href="javascript: countries.expandit('favorite')">Select Tab with ID "favorite"</a></p>

Dynamically loading an external page using Ajax

You can dynamically load an external page into the Ajax Tabs content container via Ajax, such as by using a link on the page. It's done with the below method:

Code:
instance.loadajaxpage(pageurl)
"pageurl" should be the full URL or path to the external file on your server. You cannot use this method to load a page from an outside domain, due to Ajax domain restrictions:

Code:
<p><a href="javascript: countries.loadajaxpage('external5.htm')">Load "external5.htm" into content container via Ajax</a></p>
<p><a href="javascript: countries.loadajaxpage('http://www.mysite.com/content/external5.htm')">Load into "external5.htm" content container via Ajax</a></p>
The selected tab in this case doesn't change when you load a new page directly into the content container using this method.

Dynamically loading an external page using IFRAME

You can also load an external page into the Ajax Tabs content container via IFRAME. What this does is erase whatever previous content was inside the content container, add an IFRAME tag into it, and load the desired page into the IFRAME:
Code:
instance.loadiframepage(pageurl)
"pageurl" should be the full URL or path to the external file on your server or beyond. Since the external page is loaded via IFRAME, the page can be either from your domain or outside as well (ie: http://www.google.com):

Code:
<p><a href="javascript: countries.loadiframepage('external5.htm')">Load "external5.htm" into content container via IFRAME</a></p>
<p><a href="javascript: countries.loadiframepage('http://www.google.com')">Load Google Homepage into content container via IFRAME</a></p>
In case you're wondering, the IFRAME tag that's added to the content container always carries the CSS class name "tabcontentiframe" and a name attribute of "_ddajaxtabsiframe-contentdivid", where "contentdivid" is the ID of the content container (ie: "countrydivcontainer"). You can further use this information to either style the IFRAME using CSS, or manipulate it somehow by directly accessing it via its name attribute.

Last edited by bobster65; 02-07-2008 at 09:17 AM.
Reply With Quote
  #3  
Old 10-26-2007, 03:35 PM
bobster65 bobster65 is offline
Senior Member
 
Join Date: Mar 2006
Posts: 587
Default Re: AJAX Tabs Content Script v2.0 enhanced

** ADDITIONAL CONTENT FILES **

This Post will be used to identify member submitted content files and enhancements as well as additional content files that I release.

Attached to this Post:

**UPDATED** RECENT THREADS 09-01-2008 - tabrecentthreadsexp2.php - This file includes Post ICON Column and the ability to set a specific Thread Title Character cut off amount. The UPDATE includes both database thread marking and cookie based thread marking. Various settings at the top of the file make install/Setup a breeze.

**UPDATED** RECENT THREADs with THUMBNAIL 09-01-2008 - tabthumbs.php - This file is the same as tabrecentthreadsexp2.php with the addition of displaying a thumbnail in place of the post ICON if there is a image attached to the first post. You can see an example of this @ www.veggieblogs.com specifically the RECIPES or Cookbooks Tabs. The UPDATE includes both database thread marking and cookie based thread marking. Various settings at the top of the file make install/Setup a breeze.

NEW vB Blogs 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.

NEW vBa Links 02-08-2008 - tab_latestlinks.php & tab_latestlinksexp.php - These 2 files are for displaying data from vba links directory (you must have vba links installed for this to work) See this thread for more explanation (http://www.vbadvanced.com/forum/show...&postcount=289)

Member Submitted Enhancements:

Date - Attachment name - Description - Member Name

11-25-2007 - tabexternal.php - Recent Threads Variation (For anyone that likes the default vb look of your table header, here is the way I did it.) - Glorify
http://www.vbadvanced.com/forum/show...&postcount=128



What to make your own?
Here is an example of how I replicate the User CP CMPS Block in a Tab

PHP Code:
<?php

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

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''tabwelcome'); // 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('TEST');

// 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');
require_once(
'./includes/functions_user.php');
require_once(
'./includes/functions_reputation.php');

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

?>


<?php

//Get Avatar
    
$avatarurl fetch_avatar_url($vbulletin->userinfo['userid']);
        if (
$avatarurl[0])
        {
            
$avatarurl $vbulletin->options['bburl'] . '/' $avatarurl[0];
        }
        else 
        {
            
$avatarurl "/forums/images/misc/noavatar.gif"// ADD PATH TO THE LOCATION OF YOUR NO AVATAR image
        
}

//Get Rep Images
    
fetch_reputation_image($vbulletin->userinfo$permissions);

//Get Rep Power
    
$reppower vb_number_format(fetch_reppower($vbulletin->userinfo$permissions));

//Get Rank Image
    
$vbulletin->userinfo['rank'] = str_replace('src="''src="' $vbulletin->options['bburl'] . '/'$vbulletin->userinfo['rank']);

// New posts
        
if (strlen($vbulletin->session->vars['newposts']) > AND !$vbulletin->options['threadmarking'])
        {
            
$newposts number_format($vbulletin->session->vars['newposts']);
        }
        else
        {
            
$getnewposts $db->query_first("
                SELECT COUNT(*) AS count
                FROM " 
TABLE_PREFIX "post AS post
                " 
iif($vbulletin->options['threadmarking'],
                    
'LEFT JOIN ' TABLE_PREFIX 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' $vbulletin->userinfo['userid'] . ')') . "
                WHERE dateline >= " 
$vbulletin->userinfo['lastvisit'] .
                    
iif($vbulletin->options['threadmarking'],
                        
' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)') . "
                    AND visible = 1
            "
);

            if (!
$vbulletin->options['threadmarking'])
            {
                
$db->query_write("UPDATE " TABLE_PREFIX "session SET newposts = '$getnewposts[count]' WHERE userid = " $vbulletin->userinfo['userid']);
            }

            
$newposts vb_number_format($getnewposts['count']);
        }

//Get PM Quota, PM Total and PM Unread
    
$permissions['pmquota'] = vb_number_format($permissions['pmquota']);
    
$vbulletin->userinfo['pmtotal'] = vb_number_format($vbulletin->userinfo['pmtotal']);
    
$vbulletin->userinfo['pmunread'] = vb_number_format($vbulletin->userinfo['pmunread']);
    
//Echo Content into Tab Div    

echo '<table border="0" cellpadding="6" cellspacing="1" class="tborder" width=100%>';

echo 
'<tr> <td class="alt1"><a href="/forums/profile.php?do=editavatar"><img src="'$avatarurl '" border="0" alt="Edit Avatar" /></a> </td> <td class="alt2" valign="top" width="100%">    <div class="smallfont" style="float:'$stylevar[right] . '">Rep Power: ' $reppower ' <div align="' $stylevar[right] . '" style="padding-bottom:' $stylevar[cellpadding] .'px">' $vbulletin->userinfo['reputationdisplay'] . '</div> <div align="' $stylevar[right] . '" style="padding-top:' $stylevar[cellpadding] . 'px; padding-bottom:' $stylevar[cellpadding] . 'px">' $vbulletin->userinfo['rank'] . '</div>     </div> <span class="smallfont"> Welcome back &nbsp;<b>' $vbulletin->userinfo['username'] . '</b><br /> You last visited: &nbsp;' $vbulletin->userinfo['lastvisitdate'] . '<br /> <a href="/forums/search.php?do=getnew">New Posts</a>: ' $newposts '<br /> <a href="/forums/login.php?' $session[sessionurl] . 'do=logout&amp;logouthash=' $vbulletin->userinfo['logouthash'] . '">Log Out</a>    </span></td></tr>';

// Echo Private Message portion of the User CP Block

echo '<tr> <td class="thead" colspan="2"><a href="/forums/private.php">Private Messages</a></td></tr>';
echo 
'<tr> <td class="alt1" colspan="2"><span class="smallfont">' $vbulletin->userinfo['pmunread'] . ' New PMs. You have ' $vbulletin->userinfo['pmtotal'] . ' total out of ' $permissions['pmquota'] . ' allowed.</span></td></tr>';

// End Private Message portion of the User CP Block

echo "</table>";

// The below can be removed if you don't want the Horizontal Rule and additional space for adding some custom text/sitemessage/other code.. 

echo "<hr>";

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

echo 
'<tr> <td class="smallfont">THIS IS WHERE YOU CAN ADD A SITE MESSEAGE OR WHAT EVER... YOU CAN ALSO JUST GET RID OF IT AS WELL.  SIMPLY COMMENT OUT OR REMOVE LINE 109 THRU 115... </td></tr>';

echo
'</table>';

// End additional Comment area...

?>


...
Attached Files
File Type: php tab_blog.php (3.4 KB, 83 views)
File Type: php tab_latestlinks.php (3.9 KB, 55 views)
File Type: php tab_latestlinksexp.php (4.2 KB, 36 views)
File Type: php tabrecentthreadsexp2.php (9.8 KB, 38 views)
File Type: php tabthumb.php (10.4 KB, 30 views)

Last edited by bobster65; 09-01-2008 at 05:57 PM. Reason: Added new recent threads with Icon support
Reply With Quote
  #4  
Old 10-26-2007, 07:02 PM
bobster65 bobster65 is offline
Senior Member
 
Join Date: Mar 2006
Posts: 587
Default Re: AJAX Tabs Content Script v2.0 enhanced

Don't be afraid to ask questions. I'll support this as best as I can.

Also, to other coders, feel free to enhance this and share your modifications to it.
Reply With Quote
  #5  
Old 10-26-2007, 07:45 PM
trana trana is offline
Senior Member
 
Join Date: Apr 2005
Posts: 290
Default Re: AJAX Tabs Content Script v2.0 enhanced

Great update! I haven't installed it yet but there are a lot of cool features.

BTW, the last image that is attached here shows a latest post VBA module. How did you get it to do that? On your v1 release it only had the modified module which didn't match the style for the rest of the VBA page.

Thanks!

Last edited by trana; 10-26-2007 at 07:47 PM.
Reply With Quote
  #6  
Old 10-26-2007, 08:41 PM
ezequiel ezequiel is offline
Junior Member
 
Join Date: Oct 2007
Posts: 25
Default Re: AJAX Tabs Content Script v2.0 enhanced

this is awesome man!!! thanks so much for this...
Reply With Quote
  #7  
Old 10-27-2007, 02:17 AM
fozo fozo is offline
Senior Member
 
Join Date: Oct 2007
Posts: 100
Default Re: AJAX Tabs Content Script v2.0 enhanced

I received this error message eventhough it congratulated me for installed it sucessfully
Code:
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/vba_cmps_include_template.php on line 47
Congrats  Admin!

You have successfully added AJAX Tab Content to your Site.
Also, the tab is now sitting below, not on the top? And how are we going to center the tab box within the wrapper? Also, how am I going to create adv_portal_alt_module_wrapper?

my site: http://www.vshares.net

Last edited by fozo; 10-27-2007 at 02:33 AM.
Reply With Quote
  #8  
Old 10-27-2007, 04:04 AM
tijeni tijeni is offline
Junior Member
 
Join Date: Oct 2007
Posts: 8
Default Re: AJAX Tabs Content Script v2.0 enhanced

I"m getting the same problem
Reply With Quote
  #9  
Old 10-27-2007, 09:52 AM
bobster65 bobster65 is offline
Senior Member
 
Join Date: Mar 2006
Posts: 587
Default Re: AJAX Tabs Content Script v2.0 enhanced

Quote:
Originally Posted by trana View Post
Great update! I haven't installed it yet but there are a lot of cool features.

BTW, the last image that is attached here shows a latest post VBA module. How did you get it to do that? On your v1 release it only had the modified module which didn't match the style for the rest of the VBA page.

Thanks!
The attached file contains 3 files (tabexternal2.php, tabexternal3.php, tabexternal4.php). Each one of those contains code that will display recent threads. The visual output can be changed to match that of your site. Its just a matter of echoing out some additional variables. I can help you achieve the look/display you want.


Quote:
Originally Posted by ezequiel View Post
this is awesome man!!! thanks so much for this...
No Problem..

Quote:
Originally Posted by fozo View Post
I received this error message eventhough it congratulated me for installed it sucessfully
Code:
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/vba_cmps_include_template.php on line 47
Congrats  Admin!

You have successfully added AJAX Tab Content to your Site.
ah, ya some people are not having much luck with that file being included... just remove it from all of the content php files.....

Remove the line in Red (in each php file)

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

Quote:
Originally Posted by tijeni View Post
I"m getting the same problem
See above..


Quote:
Originally Posted by fozo View Post
Also, the tab is now sitting below, not on the top? And how are we going to center the tab box within the wrapper? Also, how am I going to create adv_portal_alt_module_wrapper?

my site: http://www.vshares.net
There are 3 different CSS Styles. The one that I used in the new sample is indeed inverted, however, you can switch the CSS to either the shaded tabs or the other one (which are both on the top)... I will be adding some additional info on how to do this as there are some modifications that need to be made to the Template along with the CSS change for thte different layout. Hang on for a few days and I will get something to help you out...

I attached the code for the alt wrapper in a text file. All you need to do is create a new template and name it adv_portal_alt_wrapper and do that for each style you have on your site..

Centering is done just like you center any other module...
Reply With Quote
  #10  
Old 10-27-2007, 10:48 AM
bobster65 bobster65 is offline
Senior Member
 
Join Date: Mar 2006
Posts: 587
Default Re: AJAX Tabs Content Script v2.0 enhanced

Quote:
Originally Posted by fozo View Post
Also, the tab is now sitting below, not on the top? And how are we going to center the tab box within the wrapper? Also, how am I going to create adv_portal_alt_module_wrapper?

my site: http://www.vshares.net
ok, here is what you do to get a different look (Tabs on the top)...

Different Tab Layout Styles

The attached CSS file contains CSS for 3 different layout styles. To change the inverted style that is preset with the sample, edit the adv_portal_TAB_BLOCK_MAIN template (or what ever you named it) to one of the below samples.. both samples below have the tabs on the top. Don't REPLACE then entire template, only the like code..

This layout is for the shadetabs CSS

Code:
<ul id="tabs" class="shadetabs">
<li><a href="tabexternal.php" rel="tabcontainer" class="selected">Tab 1</a></li>
<li><a href="tabexternal2.php" rel="tabcontainer">Tab 2</a></li>
<li><a href="tabexternal3.php" rel="tabcontainer">Tab 3</a></li>
<li><a href="tabexternal4.php" rel="tabcontainer">Tab 4</a></li>
</ul>

<div id="divcontainer" style="border:1px solid gray; width:450px; margin-bottom: 1em; padding: 10px">
</div>

<script type="text/javascript">

var mytabs=new ddajaxtabs("tabs", "divcontainer")
mytabs.setpersist(true)
mytabs.setselectedClassTarget("link") //"link" or "linkparent"
mytabs.init()

</script>
This layout is for the indentmenu CSS

Code:
<div id="tabs" class="indentmenu">
<ul>
<li><a href="tabexternal.php" rel="tabcontainer" class="selected">Tab 1</a></li>
<li><a href="tabexternal2.php" rel="tabcontainer">Tab 2</a></li>
<li><a href="tabexternal3.php" rel="tabcontainer">Tab 3</a></li>
<li><a href="tabexternal4.php" rel="tabcontainer">Tab 4</a></li>
</ul>
<br style="clear: left" />
</div>

<div id="divcontainer" style="border:1px solid gray; width:550px; height: 150px; padding: 5px; margin-bottom:1em">
</div>


<script type="text/javascript">

var mytabs=new ddajaxtabs("tabs", "divcontainer")
mytabs.setpersist(false)
mytabs.setselectedClassTarget("link")
mytabs.init()


</script>
Reply With Quote
  #11  
Old 10-27-2007, 01:31 PM
fozo fozo is offline
Senior Member
 
Join Date: Oct 2007
Posts: 100
Default Re: AJAX Tabs Content Script v2.0 enhanced

thanks and how am I going to change the bg to match with other bg box?

Last edited by fozo; 10-27-2007 at 01:40 PM.
Reply With Quote
  #12  
Old 10-27-2007, 02:09 PM
bobster65 bobster65 is offline
Senior Member
 
Join Date: Mar 2006
Posts: 587
Default Re: AJAX Tabs Content Script v2.0 enhanced

Quote:
Originally Posted by fozo View Post
thanks and how am I going to change the bg to match with other bg box?
Either in the CSS or the DIV attributes within the Template. Depends on which layout you are using.
Reply With Quote
  #13  
Old 10-27-2007, 02:49 PM
fozo fozo is offline
Senior Member
 
Join Date: Oct 2007
Posts: 100
Default Re: AJAX Tabs Content Script v2.0 enhanced

I am using the default wrapper. I am still having hard time to find out how to create the wrapper from your instruction :-)

Also, the loading icon is not showing up. Do I need to change the image path or anything?

Last edited by fozo; 10-27-2007 at 03:02 PM.
Reply With Quote
  #14  
Old 10-27-2007, 03:52 PM
bobster65 bobster65 is offline
Senior Member
 
Join Date: Mar 2006
Posts: 587
Default Re: AJAX Tabs Content Script v2.0 enhanced

Quote:
Originally Posted by fozo View Post
I am using the default wrapper. I am still having hard time to find out how to create the wrapper from your instruction :-)

Also, the loading icon is not showing up. Do I need to change the image path or anything?
The wrapper is nothing but a template. The code in the text file is the code that needs to go into a new template. Simple as that.

Steps...
1. Log into the ACP

2. Expand the Styles and Templates Navigation Block.

3. Click on Style Manager. This will bring up a list of all your styles.

4. Each Style has a drop down box that has different functions. One of those functions is to ADD a new template. Soooooo, for the Style you want to create a new template for, envoke the drop down list and choose ADD new template.

5. Now you have a nifty blank template input shell area.

6. Copy the code in the text file and place it into the large input box.

7. Name your template... I named mine adv_portal_alt_module_wrapper

8. Hit save

9. Edit the Module that you want to use this wrapper with.

In the Module Wrapper Template Options area of the Module:

Use Module Wrapper Template - YES

Alternative Module Wrapper Template - enter the name of the template you created in step 7

Thats it. Simple as can be.
Reply With Quote
  #15  
Old 10-27-2007, 03:54 PM
Lionel Lionel is offline
Senior Member
 
Join Date: Jan 2004
Location: Miami
Posts: 1,040
Default Re: AJAX Tabs Content Script v2.0 enhanced

This is a nice mod. I can tell you put a lot of effort. Congratulations.
Reply With Quote
  #16  
Old 10-27-2007, 03:54 PM
bobster65 bobster65 is offline
Senior Member
 
Join Date: Mar 2006
Posts: 587
Default Re: AJAX Tabs Content Script v2.0 enhanced

Quote:
Originally Posted by fozo View Post
Also, the loading icon is not showing up. Do I need to change the image path or anything?
edit the ajaxtabs.js file. The path setting for the ICON is at the beginning of the script.
Reply With Quote
  #17  
Old 10-27-2007, 04:03 PM
bobster65 bobster65 is offline
Senior Member
 
Join Date: Mar 2006
Posts: 587
Default Re: AJAX Tabs Content Script v2.0 enhanced

Quote:
Originally Posted by Lionel View Post
This is a nice mod. I can tell you put a lot of effort. Congratulations.
Thank You Lionel and feel free to expand on it or write custom content for members.. Custom Content is the real power behind it
Reply With Quote
  #18  
Old 10-27-2007, 04:09 PM
fozo fozo is offline
Senior Member
 
Join Date: Oct 2007
Posts: 100
Default Re: AJAX Tabs Content Script v2.0 enhanced

awesome work. Thanks Bob for this great add-on.
Reply With Quote
  #19  
Old 10-27-2007, 04:15 PM
Lionel Lionel is offline
Senior Member
 
Join Date: Jan 2004
Location: Miami
Posts: 1,040
Default Re: AJAX Tabs Content Script v2.0 enhanced

I'e just finished a couple more hacks. Pagination within a thread (multipages)
And .... vBattach. 5 ways to display your attachments thumbs in vb. top, bottom (vb default), align left, align right, alternate initial right, alternate initial left. And they display exactly where you want them to :-) All query free
Reply With Quote
  #20  
Old 10-27-2007, 08:44 PM
fozo fozo is offline
Senior Member
 
Join Date: Oct 2007
Posts: 100
Default Re: AJAX Tabs Content Script v2.0 enhanced

how are you going to close the gap between the tab?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[AJAX] Tabbed Content Module v2.0 bobster65 Add-On Modules (version 3.x & 2.x) 117 06-06-2008 11:43 AM
AJAX Tabbed Content Module bobster65 Add-On Modules (version 3.x & 2.x) 39 09-11-2007 12:47 PM
Will pay to have 'Recent Threads' enhanced amagab Module & Modification Discussion & Requests 1 08-10-2007 11:29 PM
Then Enhanced Nav Menu is Broken uncledave Site Feedback & Updates 0 09-24-2006 09:05 PM


All times are GMT -4. The time now is 08:21 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.