PDA

View Full Version : Add-On Releases - Module CMPS: AJAX Tabbed Content


bobster65
08-07-2007, 10:00 PM
AJAX Tabs - Version 1.5

Note: Version 1.0 is still available as a secondary option and is located in post 2 of this thread.

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

Whats changed within this release?: This new version (based on the AJAX Tabs script written by Dynamic Drive - http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm) utilizes Ajax to display a selection of external content on your page inside a DIV and via CSS tabs. Below lists the features of this script that together make it highly adaptable in the real world:


Fetch and display an external page (from the same domain) inside a container when a tab is clicked on.
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 directly to your page and not fetched via Ajax, for sake of server efficiency.
For each tab, you can not only fetch an external page to be shown, but also load external .css and .js files associated with that page if desired.
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.
Supports multiple Ajax Tabs Contents on the same page.
Fully unobtrusive, search engine friendly script. The tabs are simply list based links. For search engines or browsers with JavaScript disabled, the contents will just load as actual pages (instead of inline via Ajax).

As I mentioned in the previous release, I received many emails & PMs about how I implemented AJAX Tabbed Modules within vBadvance & vB, so instead of replying to each one seperately, I went ahead and wrote up this "how to". 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 module is, check out the attached screen shots for a visual.

This is what I've done so far to implement AJAX Tabs functionality within vBadvance for my websites and others....

CMPS Version Note: Coded for CMPS v3.0 RC1. 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, adv_portal_alt_module_wrapper (optional)
Files: ajaxtabs.js, ajaxtabs.css, Sample Content Files, images(3)

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.
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.

CSS file - Name: ajaxtabs.css
.shadetabs{
padding: 3px 0;
margin-left: 0;
margin-top: 1px;
margin-bottom: 0;
font: bold 12px Verdana;
list-style-type: none;
text-align: left; /*set to left, center, or right to align the menu as desired*/
}

.shadetabs li{
display: inline;
margin: 0;
}

.shadetabs li a{
text-decoration: none;
padding: 3px 7px;
margin-right: 3px;
border: 1px solid #778;
color: #FFFFFF;
background: #343958 url(http://www.domain.com/forums/ajaxtabs/shade.gif) top left repeat-x;
}

.shadetabs li a:visited{
color: #FFFFFF;
}

.shadetabs li a:hover{
text-decoration: underline;
color: #FFFFFF;
}

.shadetabs li.selected{
position: relative;
top: 1px;
}

.shadetabs li.selected a{ /*selected main tab style */
background-image: url(http://www.domain.com/forums/ajaxtabs/shadeactive.gif);
border-bottom-color: gray;
}

.shadetabs li.selected a:hover{ /*selected main tab style */
text-decoration: none;
}

.contentstyle{
border: 1px solid gray;
width: 425px;
margin-bottom: 0em; padding: 2px;
background: white;
}


Step 3. Create, Name and Upload Multiple "Content" files.
I've included working samples in the attached Zip File.
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: Modifications to these files can be made once you get the initial system up and running.

Sample PHP "Content" file - Sample name: tabexternal.php
<?php

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

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

// 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 'HELLO WORLD! Welcome to AJAX TABs ....';

?>


Sample HTM "Content" file - Sample name: tabexternal.htm

<img src="ajaxtabs/bird.jpg" style="float: left; margin: 0 10px 5px; border: 1px solid gray" />
Birds are bipedal, warm-blooded, oviparous vertebrate animals characterized primarily by feathers, forelimbs modified as wings, and hollow bones.
<br style="clear: left" />




Step 4. (optional) Create an Alternative Module Wrapper Template.
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. I named mine - adv_portal_alt_module_wrapper

Alternative Module Wrapper Template - Sample name: adv_portal_alt_module_wrapper
<div style="padding-bottom:$vba_style[portal_vspace]px">
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" width="100%">

<tbody id="collapseobj_module_$mods[collapse]" style="$modcollapse">
<if condition="$show['tablerow']">
<tr>
<td class="$bgclass">
$modulehtml
</td>
</tr>
<else />
$modulehtml
</if>
</tbody>
</table>
</div>


Step 5. Create a new Template.
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 template below, HOWEVER, there are some edits that you will need to make to the code based upon steps 1-3 above.

Custom Template Sample name: adv_portal_Tab_Block_Main
<tr><td>
<head>
<link rel="stylesheet" type="text/css" href="/forums/ajaxtabs/ajaxtabs.css" />
<script type="text/javascript" src="/forums/ajaxtabs/ajaxtabs.js">
/***********************************************
* Ajax Tabs Content script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
</head>
<body>

<ul id="maintab" class="shadetabs">
<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>
</ul>

<div id="ajaxcontentarea" class="contentstyle">
<p>Congrats, AJAX Tabbed Content is working on your site!</p>
</div>

<script type="text/javascript">
//Start Ajax tabs script for UL with id="maintab" Separate multiple ids each with a comma.
startajaxtabs("maintab")
</script>
</body>
</td></tr>

EDITS NEEDED TO THE ABOVE 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.
<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 ahahLib.js file.
<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).
<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 initially say "Congrats, AJAX Tabbed Content is working on your site!" as that will preload, Click on Tab 1 and it will retrieve via AJAX, the code created in the external file for tab 1. Click on the other tabs to retrieve the info created within those external files..


CUSTOMIZATION

Style: Modify CSS File in Step 2 to match the Style of your site.

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

<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

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)


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.

<li><a href="http://www.domain.com/forums/CONTENT FILE" rel="ajaxcontentarea">TAB NAME</a></li>
Example:
<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.


If you want to read up on AJAX Tabs, check out the Ajax Tabs Content script over at Dynamic Drive (http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/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 Modules. 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 some dynamic content based on the user.
The 2nd is an example of modified recentthreads.php used within a tab.
The 3rd is an example of using modified vbarticles within a tab.
The 4th and 5th are examples of custom dynamic content within a tab.

bobster65
08-08-2007, 02:31 PM
Version 1.0 ahahLib.js AJAX Tabs

This is what I've done so far to implement AJAX Tabs functionality within vBadvance for my websites and others using the ahahLib.js version of AJAX Tabs...

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

CMPS Module Type: TEMPLATE w/Alternative Module Wrapper Template
Templates: adv_portal_Tab_Block, adv_portal_alt_module_wrapper (optional)
Files: ahahLib.js, TabAJAX.css, tabcontent.php

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

Download the latest ahahLib.js file from crackajax.net (http://www.crackajax.net/ahahLib.js) (now included in the zip file)

Step 1. Upload the ahahLib.js file.
No modifications to this file are needed. The location I chose was the clientscript folder that comes default with your vBulletin installation.
path example: /www/forums/clientscript
It doesn't HAVE to go there, I just chose to put it there since its a common place for js files.

Step 2. Create, Name and Upload CSS file.
The location I chose was the vbulletin_css folder that comes default with your vBulletin installation.
path example: /www/forums/clientscript/vbulletin_css
Again, it doesn't HAVE to go there, I just chose to put it there since its a common place for css files. You can name the css file anything you like.. I named mine TabAJAX.css .

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

CSS file - Sample Name: TabAJAX.css
pre {text-indent: 30px}

#tabmenu {
color: #000;
border-bottom: 1px solid black;
margin: 12px 0px 0px 0px;
padding: 0px;
z-index: 1;
padding-left: 10px }

#tabmenu li {
display: inline;
overflow: hidden;
list-style-type: none; }

#tabmenu a, a.active {
color: #aaaaaa;
background: #295229;
font: normal 1em verdana, Arial, sans-serif;
border: 1px solid black;
padding: 2px 5px 0px 5px;
margin: 0px;
text-decoration: none;
cursor:hand; }

#tabmenu a.active {
background: #ffffff;
border-bottom: 3px solid #ffffff; }

#tabmenu a:hover {
color: #fff;
background: #ADC09F; }

#tabmenu a:visited {
color: #E8E9BE; }

#tabmenu a.active:hover {
background: #ffffff;
color: #DEDECF; }

#content {font: 0.9em/1.3em verdana, sans-serif;
text-align: justify;
background: #ffffff;
padding: 20px;
border: 1px solid black;
border-top: none;
z-index: 2; }

#content a {
text-decoration: none;
color: #E8E9BE; }

#content a:hover { background: #aaaaaa; }




Step 3. Create, Name and Upload PHP file.
The location I chose was the FORUMS root.
path example: /www/forums
You can name this file anything you want. I named mine tabcontent.php

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

PHP file - Sample name: tabcontent.php
<?php


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

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

// 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

if ($_GET['content'] == 1) {
echo 'Congrats, Insert Dynamic or Static Code here for Tab 1';

}


if ($_GET['content'] == 2) {
echo 'Insert Dynamic or Static Code here for Tab 2';
}


if ($_GET['content'] == 3) {

echo 'Insert Dynamic or Static Code here for Tab 3';
}

?>


Step 4. (optional) Create an Alternative Module Wrapper Template.
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. I named mine - adv_portal_alt_module_wrapper

Alternative Module Wrapper Template - Sample name: adv_portal_alt_module_wrapper
<div style="padding-bottom:$vba_style[portal_vspace]px">
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" width="100%">

<tbody id="collapseobj_module_$mods[collapse]" style="$modcollapse">
<if condition="$show['tablerow']">
<tr>
<td class="$bgclass">
$modulehtml
</td>
</tr>
<else />
$modulehtml
</if>
</tbody>
</table>
</div>


Step 5. Create a new Template.
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 template below, HOWEVER, there are some edits that you will need to make to the code based upon steps 1-3 above.

Custom Template Sample name: adv_portal_Tab_Block
<tr><td >
<body onload="makeactive(1)">
<link href="http://www.domain.com/forums/clientscript/vbulletin_css/TabAJAX.css" rel="stylesheet" type="text/css">

<script language="JavaScript" type="text/javascript" src="http://www.domain.com/forums/clientscript/ahahLib.js"></script>
<script language="JavaScript" type="text/javascript">
function makeactive(tab) {
document.getElementById("tab1").className = "";
document.getElementById("tab2").className = "";
document.getElementById("tab3").className = "";
document.getElementById("tab"+tab).className = "active";
callAHAH('http://www.domain.com/forums/tabcontent.php?content= '+tab, 'content', 'getting content for tab '+tab+'. Wait...', 'Error');
}
</script>

<ul id="tabmenu" >
<li onclick="makeactive(1)"><a class="" id="tab1">Tab 1</a></li>
<li onclick="makeactive(2)"><a class="" id="tab2">Tab 2</a></li>
<li onclick="makeactive(3)"><a class="" id="tab3">Tab 3</a></li>
</ul>
<div id="content" class="smallfont"></div>

</td></tr>

EDITS NEEDED TO THE ABOVE TEMPLATE:

EDIT 1 - Path location of the CSS file created in step 2. Simply edit this line in the template to the correct path where you uploaded the CSS File.
<link href="http://www.domain.com/forums/clientscript/vbulletin_css/TabAJAX.css" rel="stylesheet" type="text/css">

EDIT 2 - Path location of the ahahLib.js file in step 1. Simply edit this line in the template to the correct path where you uploaded the ahahLib.js file.
<script language="JavaScript" type="text/javascript" src="http://www.domain.com/forums/clientscript/ahahLib.js"></script>

EDIT 3 - Path location of the PHP file created in step 3. Simply edit this line in the template to the correct path where you uploaded the PHP file.
callAHAH('http://www.domain.com/forums/tabcontent.php?content= '+tab, 'content', 'getting content for tab '+tab+'. Wait...', 'Error');


NOTE: the body onload function is to force a tab active when the page is first loaded... I added this to the template so that you could designate a tab other than the first tab to be opened in case of an important issue that you may want people to see in (for example) tab 3. Its set at 1 default. To force the opening of another tab, change the # to the tab you wish to be open... the below will open Tab 3 when ever the page is first accessed or refreshed.

<body onload="makeactive(3)">


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 3 tabs named Tab 1, Tab 2, Tab 3. The content for Tab 1 will say "Congrats, Insert Dynamic or Static Code here for Tab 1"


CUSTOMIZATION

Style: Modify CSS File created in Step 2 to match the Style of your site.

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

<li onclick="makeactive(1)"><a class="" id="tab1">Announcements</a></li>


Content: Modify PHP File 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
if ($_GET['content'] == 1) {
echo "Welcome Back {$vbulletin->userinfo['username']}!<br><br>
Hope you are enjoying the off season so far. The Draft & Mini Camps are complete, now its just a few weeks away from Training Camp 2007.
<br><br>
Im sure these next few months will be fun to follow and make the upcoming season even more exciting. Good luck with your team {$vbulletin->userinfo['username']}!";

}


NOTE: You can get as creative as you want to with content. For example, I took code from the recentthreads.php file, modified it and included that as tab content to display recent threads within a tab on my site (as seen in the screen shots attached in Post 1 of this thread).


ADDING MORE TABS

To add more tabs, you will need to modify the template created in Step 5 and the PHP file created in Step 3.

Step 1. Add the following 2 lines of code to the Template that you created in Step 5 for each new Tab that you want to appear. Make sure that when you add the lines that you keep them in order with the other lines currently in the file.

document.getElementById("tab4").className = "";

<li onclick="makeactive(4)"><a class="" id="tab4">Tab 4</a></li>

Step 2. Add the following block of code to the PHP file created in Step 3. Make sure that you keep it in order with the other blocks of code currently in the file.

if ($_GET['content'] == 4) {

echo 'Insert Dynamic or Static Code here for Tab 4';
}

If you want to read up on AJAX Tabs, check out the Ajax Project - Tabbed Page Interface over at crackajax (http://www.crackajax.net/tabs.php)

Well....thats it in a nutshell....Sorry for such a long post. I do hope that I explained things well enough to at least get a head start on AJAX Tabbed Modules using the ahahLib.js script. Let me know if you have any problems or need further explanation on anything...

Thanks and enjoy :) Bobster

blogtorank
08-08-2007, 02:32 PM
Wow nice, will be installing later here, happen to post in another thread and read the overall and seen AJAX, GOTTA love it!

Will put this to use later for sure.

sensimilla
08-08-2007, 03:36 PM
Outstanding work, thanks alot for this one.

radarhunter
08-08-2007, 05:47 PM
i also have sumthin` like this on my site and so does Brandon but u`ve for the perfect thing what we needed to make out of our Tab codes.........

Seriously i`m not jokin` the whole work has been discussed here :) [Please Click Here] (http://forum.vbulletinsetup.com/f18/how-integrate-tabcontent-vbadv-3012.html)

Thanks man u`ve helped us a lot.....

radarhunter
08-08-2007, 06:18 PM
jus` out of curiosity i wanted to ask u that where is the code for the one in the second picture.......

how do we integrate the latest posts in the tab contents.... And can we integrate the latests posts from different sections....

I mean under the Entertainment tab there are only latest posts of entertainment section under music latest news in music section like this ........

Can this happen or if has what are the exact codes of this please ?????

Deepdog009
08-08-2007, 06:24 PM
Great work Bobster65,

CSS & Ajax are taking over...;)

Keep the ball rolling...:up:

bobster65
08-08-2007, 06:27 PM
jus` out of curiosity i wanted to ask u that where is the code for the one in the second picture.......

how do we integrate the latest posts in the tab contents.... And can we integrate the latests posts from different sections....

I mean under the Entertainment tab there are only latest posts of entertainment section under music latest news in music section like this ........

Can this happen or if has what are the exact codes of this please ?????

Im going to be writing a "how to" on how to mimic the recent threads module within this Module. Its not ready for public release yet. The one you see in the 2nd image is code that I modified from vBadvanced recentthreads.php module.

You can easily do what you want to do. I've helped a few members out over at vBadvance do just what you are asking. I won't release code to the public tho until I am comfortable knowing there are no security holes and or bugs.

radarhunter
08-08-2007, 06:30 PM
k did u see my site ? .... I hope i have the same outcome of what u`re showing here.........

And if possible please take out the second pic off ur thread as then till the time the codes for which are not included the same should not be shown as pics to the public *just a suggestion*

bobster65
08-08-2007, 07:23 PM
k did u see my site ? .... I hope i have the same outcome of what u`re showing here.........

And if possible please take out the second pic off ur thread as then till the time the codes for which are not included the same should not be shown as pics to the public *just a suggestion*

I just checked it out. Looks like you are using the tab script from dynamic drive. I use that one as well from time to time for various web applications (I also use codethattab for various web apps).

If you are interested, I'll hook you up with some beta code that you can modify & test with the understanding that it won't be released publicly until its stable.. .. just PM me when you have time.

As for the screen shots, they are two fold. Number one is to give members an idea of what Tabbed Modules are/look like. Number two is to give members/designers/coders an idea of what can be done content wise. This initial how to is about the Tabbed Module itself tho, not the content within the module. Coders are more than welcome to write/share Dynamic Content Blocks of code for this module as I plan to as well. Im also more than willing to help people out with both custom static and dynamic content (as time permits)..

radarhunter
08-08-2007, 07:28 PM
If you are interested, I'll hook you up with some beta code that you can modify & test with the understanding that it won't be released publicly until its stable.. .. just PM me when you have time.

okay count me in

concepts
08-08-2007, 08:35 PM
And if possible please take out the second pic off ur thread as then till the time the codes for which are not included the same should not be shown as pics to the public *just a suggestion*

are you serious? hahaha... this is simply a modification to allow members to have "tabbed" modules... the photos show the functionality in which the "tabbed modules" can be used for.. leave your personal thoughts to yourself.

Brandon Sheley
08-08-2007, 09:11 PM
I just added the tab featured from DD on vBulletin Setup (http://www.vbulletinsetup.com)

I may have to remove it and try this one out :)

Dr. Bantham
08-09-2007, 12:55 AM
Nice one! I have this working in the test mode. I hope to be able to utilize many of my VBA modules in this format. I do have a question regarding styles. It seems that the CSS file approach is not conducive to accommodating sites with multiple styles. How can we work around this? Ideally, these settings would adhere to the current style.

beduino
08-09-2007, 02:26 AM
It is a big mod!
But.. if it is possible you can tell how insert last threads and last news [vba] in dynamic content?
Tks in advance
Beduino

radarhunter
08-09-2007, 05:01 AM
are you serious? hahaha... this is simply a modification to allow members to have "tabbed" modules... the photos show the functionality in which the "tabbed modules" can be used for.. leave your personal thoughts to yourself.

are u a lunatic - can`t u see what i wrote . I wrote that when the feature is currently not available in the mod the pics for such should not be there. When the code for such is given in the mod then the pics should be given .....

bobster65
08-09-2007, 11:59 AM
I just added the tab featured from DD on vBulletin Setup (http://www.vbulletinsetup.com)

I may have to remove it and try this one out :)

I checked yours out yesterday... the dynamicdrive ajax script works just fine. They both accomplish the same end result which is what a lot of us are after. I was actually thinking about writing about both the dynamicdrive script and codethattab script as other options available.

Nice one! I have this working in the test mode. I hope to be able to utilize many of my VBA modules in this format. I do have a question regarding styles. It seems that the CSS file approach is not conducive to accommodating sites with multiple styles. How can we work around this? Ideally, these settings would adhere to the current style.

Ya, multiple styles does raise somewhat of an issue. Im sure a work around is feasable, I just have not focused on one. Maybe someone that has some time can look into that part?

It is a big mod!
But.. if it is possible you can tell how insert last threads and last news [vba] in dynamic content?
Tks in advance
Beduino

I mentioned a few posts back that I have some beta code that Im willing to share. Its not ready for public release tho (sorry)... blast me a PM and I'll hook you up so you can test it out and modify it to meet your needs.

nymyth
08-09-2007, 12:52 PM
HOLY MOLY....LOVE IT.....installed

nymyth
08-09-2007, 01:28 PM
is it possible to rotate among the tabs if you stay on the homepage....similar to how yankees.com and other sports sites do for their current news.

bobster65
08-09-2007, 01:32 PM
is it possible to rotate among the tabs if you stay on the homepage....similar to how yankees.com and other sports sites do for their current news.

That is something that I have on my "to look into" list as I want that feature on my site. I see no reason why it can't be done. It MAY require a seperate, but similar module, but certainly is doable in theory.

nymyth
08-09-2007, 01:43 PM
I put this in, however its moved all my boxes into one column....instead of the 2 columns it was before....where did i mess up?

bobster65
08-09-2007, 01:54 PM
I put this in, however its moved all my boxes into one column....instead of the 2 columns it was before....where did i mess up?

Did you make sure to use the module wrapper or the alt mod wrapper?

Brew
08-09-2007, 01:57 PM
Would this also show on the top of the forums?

I don't use a CMS (actually WordPress with a vB bridge) but I would like this on the top of my forums.

Also...

Anyone out there want to turn this into a full fledged Plugin? (that would be awesome)

bobster65
08-09-2007, 02:05 PM
Would this also show on the top of the forums?

I don't use a CMS (actually WordPress with a vB bridge) but I would like this on the top of my forums.

Also...

Anyone out there want to turn this into a full fledged Plugin? (that would be awesome)

the technology can be used virtually anywhere you want to. I wrote this how to specifically for interation within CMPS, however, you could easily grab whats needed out of the example and integrate it outside of CMPS.

nymyth
08-09-2007, 02:52 PM
Did you make sure to use the module wrapper or the alt mod wrapper?
yeah i figured that out...lol....i didnt have it checked, thought it had to be turned off when using an alternate wrapper.....

bobster65
08-09-2007, 02:55 PM
yeah i figured that out...lol....i didnt have it checked, thought it had to be turned off when using an alternate wrapper.....

:eek: You joined the club as well I see :D (I did that when 3.0 first came out) lol

nymyth
08-09-2007, 02:56 PM
any chance we can implement the GARS_CMPS into this?

beduino
08-09-2007, 03:01 PM
Hello bobster65!

mentioned a few posts back that I have some beta code that Im willing to share. Its not ready for public release tho (sorry)... blast me a PM and I'll hook you up so you can test it out and modify it to meet your needs
Just pm you
All the best
Beduino

bobster65
08-09-2007, 03:04 PM
any chance we can implement the GARS_CMPS into this?

I don't see why not. I don't have GARS, so someone else will have to come up with the solution... I can't be that tough...

BuRuNDi
08-09-2007, 06:45 PM
WOOOW I love this, just what I was looking for.

Installed and working fine!!

MiahBeSmokin420
08-09-2007, 09:41 PM
Ok Problem Fixed

bobster65
08-09-2007, 09:50 PM
ok ok very nice BUT:

i am having a minor problem

i have it all loaded on my site but its not loading what i want it to

i followed all the steps perfectly and here is what i got on the coding:

what am i doing wrong

can anyone tell me please

thanks

Ya, that code is OK... I can take a look at your tabcontent.php file.. just PM it to me. The last time I saw this problem was a corrupt php file.

MiahBeSmokin420
08-09-2007, 09:59 PM
Ya, that code is OK... I can take a look at your tabcontent.php file.. just PM it to me. The last time I saw this problem was a corrupt php file.

thanks for your attempted help

i dont know what i did honestly

but now its working idk but thanks for the speedy responce

**marked as installed**

bobster65
08-09-2007, 10:06 PM
thanks for your attempted help

i dont know what i did honestly

but now its working idk but thanks for the speedy responce

**marked as installed**

Cool Beans :) Check yer PM..

MiahBeSmokin420
08-10-2007, 12:11 AM
ooh lol that was you that sent that ok cool thanks

BUT i got a new problem

i added a new tabbed modual so now i have 2

made new files for the second one and have them named diffrently then the first on

but the tabs for 1 first one controll both modules
same goes for the second module

and like i said i do have seprat files for each of then
they even have diffren css's

bobster65
08-10-2007, 12:27 PM
ooh lol that was you that sent that ok cool thanks

BUT i got a new problem

i added a new tabbed modual so now i have 2

made new files for the second one and have them named diffrently then the first on

but the tabs for 1 first one controll both modules
same goes for the second module

and like i said i do have seprat files for each of then
they even have diffren css's

ah crap... I had a total brain fart about this issue with this script.. I was thinking about the other tabajax script that I have... If you want multiple ones on the same page, I'll have to hook you up with a different one (which I will either post in the reserved post or start another MOD for it).... if you can hang on for a day, I'll get you setup.. sorry about that!

MiahBeSmokin420
08-10-2007, 11:21 PM
ah crap... I had a total brain fart about this issue with this script.. I was thinking about the other tabajax script that I have... If you want multiple ones on the same page, I'll have to hook you up with a different one (which I will either post in the reserved post or start another MOD for it).... if you can hang on for a day, I'll get you setup.. sorry about that!

ok sounds great

ill be looking forward to this

Dr. Bantham
08-11-2007, 10:17 AM
Could you provide instructions on integrating Recent Topics?

bobster65
08-11-2007, 06:30 PM
Could you provide instructions on integrating Recent Topics?

I can PM you some beta code that I have. Im heading out for the weekend right now, so it won't be sent until monday...

rainyleaves
08-12-2007, 01:44 PM
Hi,
Thanks for your mod.

I got a problem.
I have it all loaded but 'makeactive' contents is not auto loading.
Just display Tab1, Tab2, Tab3 and blank box.
But I can see this error when I clicked Tab1.
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/vba_cmps_include_template.php on line 47
Congrats, Insert Dynamic or Static Code here for Tab 1

I didn't customised any files, Just uploaded attached files.
I think I followed all the steps perfectly.

what am i doing wrong?

Please help....

Thanks :)

albn
08-12-2007, 05:23 PM
This is an excellent mod. I am wondering, does the tabs support bb code? I am guessing it does not, but of that is the case, that is fine, I'll just use regular html/css.

*installed

Lost Heaven
08-13-2007, 03:26 AM
Hi,
Thanks for your mod.

I got a problem.
I have it all loaded but 'makeactive' contents is not auto loading.
Just display Tab1, Tab2, Tab3 and blank box.
But I can see this error when I clicked Tab1.
Quote:
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/vba_cmps_include_template.php on line 47
Congrats, Insert Dynamic or Static Code here for Tab 1
I didn't customised any files, Just uploaded attached files.
I think I followed all the steps perfectly.

what am i doing wrong?

Please help....

Thanks
I have same this error too.

bobster65
08-13-2007, 12:10 PM
Hi,
Thanks for your mod.

I got a problem.
I have it all loaded but 'makeactive' contents is not auto loading.
Just display Tab1, Tab2, Tab3 and blank box.
But I can see this error when I clicked Tab1.


I didn't customised any files, Just uploaded attached files.
I think I followed all the steps perfectly.

what am i doing wrong?

Please help....

Thanks :)

I have same this error too.

Do you guys have any other custom CMPS Modules (ones that don't come with CMPS) that call custom java scripts? ... its odd that its echoing the content as well as the error.. also, what version of CMPS are you using?

rainyleaves
08-13-2007, 12:36 PM
Do you guys have any other custom CMPS Modules (ones that don't come with CMPS) that call custom java scripts? ... its odd that its echoing the content as well as the error.. also, what version of CMPS are you using?
Thanks for your reply.
Use CMPS 3.0. + Many Module.

bobster65
08-13-2007, 12:53 PM
Thanks for your reply.
Use CMPS 3.0. + Many Module.

You can either post your code or PM it to me.. post both the template and php file..

rainyleaves
08-13-2007, 01:43 PM
You can either post your code or PM it to me.. post both the template and php file..
Do you mean 'AJAX Tabbed Content''s template and php file?
I didn't customised.

Thanks :)

bobster65
08-13-2007, 01:56 PM
Do you mean 'AJAX Tabbed Content''s template and php file?
I didn't customised.

Thanks :)

yes

Lost Heaven
08-13-2007, 02:33 PM
i think i didn't customised any template and php file :(
BTW,can you tell me how to create a tab with recent posts?I confused when look the code in recentpost.php :(

bobster65
08-13-2007, 03:19 PM
i think i didn't customised any template and php file :(
BTW,can you tell me how to create a tab with recent posts?I confused when look the code in recentpost.php :(

Well, I've had a few peeps that when editing the template and php file to change the paths to fit their site, make a simple syntax error... the only thing that I can think of without taking a look at it is there might be a possible conflict with another Custom Module that is using a custom java script. What the link to your site?

bobster65
08-15-2007, 04:44 PM
AJAX TABS version 2.0 is now available as the primary option of this thread.... please review the new information as released today.

Version 1.0 information has been moved into the 2nd post of this thread for historical purposes as well as reference for those that have installed.

Thanks.. Bobster

radarhunter
08-15-2007, 05:02 PM
the one u`ve updated now i`ve been using this script for a very long time.....

Anyways nice to see it here too :D


But what i`m not able to figure out is how to embeb latest posts module codes into this ...........

bobster65
08-15-2007, 05:23 PM
the one u`ve updated now i`ve been using this script for a very long time.....

Anyways nice to see it here too :D


But what i`m not able to figure out is how to embeb latest posts module codes into this ...........

download the zip file and check out the sample php files (read the instructions.txt file as well) .. this should get you what you are after ;)

efil
08-16-2007, 04:43 AM
Hi,
Thank you for the useful mod.:up:

I have some problems with version 2.

1. The tabexterna does not fit the screen. (see attach pic).

2. My site is in hebrew, i need the tabs from right to left.

It's not working good with rtl? (see attach pic in explorer and in firefox).

2. How can i force open a specific tab as default?

bobster65
08-16-2007, 12:53 PM
Hi,
Thank you for the useful mod.:up:

I have some problems with version 2.

1. The tabexterna does not fit the screen. (see attach pic).

2. My site is in hebrew, i need the tabs from right to left.

It's not working good with rtl? (see attach pic in explorer and in firefox).

2. How can i force open a specific tab as default?

That is a CSS issue. Looks like you need to right justify. Just play around with the CSS file a little. I'll try and simulate it and see if I can come up with a solution for ya..

rainyleaves
08-17-2007, 03:55 AM
You didn't upload 'AJAX Tabs - Version 2.0' zip file.
Please upload...

bobster65
08-17-2007, 02:21 PM
You didn't upload 'AJAX Tabs - Version 2.0' zip file.
Please upload...

:eek: weird.. I uploaded it, then took it off to upload a new one with a few more examples and uploaded it again.. it was on before I left last night lol.... anywho, its there now :up:

rainyleaves
08-17-2007, 05:09 PM
:eek: weird.. I uploaded it, then took it off to upload a new one with a few more examples and uploaded it again.. it was on before I left last night lol.... anywho, its there now :up:

Thanks :)

bobster65
08-17-2007, 05:35 PM
I fixed a small problem in the .js file that was causing the "selected" tab not to preload with session persistance on (worked with it off).. it now preloads correctly... attached is the new .js file (which I will add to the zip file as well)..

Thanks... Bobster

bobster65
08-17-2007, 05:47 PM
2. How can i force open a specific tab as default?

add class="selected" to the li tag of the Tab you wish to force open.

<li class="selected"><a href="http://www.domain.com/forums/tabexternal.php" rel="ajaxcontentarea">Tab 1</a></li>

THEN

either edit the .js file from this

var enabletabpersistence=1

to this

var enabletabpersistence=0

OR

download the new .js file that I attached in the above post or grab it from the attached zip file from the main post of this thread....

The issue was a bug with persistence which has been fixed now. They both work together as long as you use the new .js file.

Thanks.. Bobster

bobster65
08-17-2007, 06:51 PM
Hi,
Thank you for the useful mod.:up:

I have some problems with version 2.

1. The tabexterna does not fit the screen. (see attach pic).

2. My site is in hebrew, i need the tabs from right to left.

It's not working good with rtl? (see attach pic in explorer and in firefox).


To right align the tabs, just find this line in the CSS file:

text-align: right; /*set to left, center, or right to align the menu as desired*/

A value of "right" like above should do it.

y2krazy
08-17-2007, 10:08 PM
Very nice mod I must say! I do have one question, though...

Is there anything like this available for the MEMBERINFO page? I would like to allow my members to add their own personal 'tabs' specifically for, let's say, and individual character they play in a role-playing game (up to X amount of tabs). It would be really nice to have a feature like you have made for CMPS made available for use on the main forums. Thanks for your time!

bobster65
08-17-2007, 10:36 PM
Very nice mod I must say! I do have one question, though...

Is there anything like this available for the MEMBERINFO page? I would like to allow my members to add their own personal 'tabs' specifically for, let's say, and individual character they play in a role-playing game (up to X amount of tabs). It would be really nice to have a feature like you have made for CMPS made available for use on the main forums. Thanks for your time!

Actually, the Tabs technology can be used within the forums as well.... its not just limited to CMPS.. I think you could accomplish what you are after fairly easy by using additional profile fields and a few template edits.... (don't hold me to do it for ya tho ;) ) I'll do a little playing around and see if I can come up with something that might work for ya.

y2krazy
08-17-2007, 11:02 PM
Actually, the Tabs technology can be used within the forums as well.... its not just limited to CMPS.. I think you could accomplish what you are after fairly easy by using additional profile fields and a few template edits.... (don't hold me to do it for ya tho ;) ) I'll do a little playing around and see if I can come up with something that might work for ya.
That would be sooo good to see. If you decide to release it, it will surely help more than just me out. ;)

jasculs
08-27-2007, 05:44 AM
I keep trying to figure it out, but I can't seem to get my recent posts in the tabs to look like how you have it or how it would like in a vbadvanced center module

bobster65
08-27-2007, 01:49 PM
I keep trying to figure it out, but I can't seem to get my recent posts in the tabs to look like how you have it or how it would like in a vbadvanced center module

PM me when you get a chance and I will try and help you out to get the result you are looking for.

ahmednadir
11-03-2007, 03:26 PM
WOOOW
This is EXACTLY!!! what I was looking for
it just come to my mind 2 minutes ago so I logged in to check if its here and there it is.
alot of editing but hope I don't mess up anywhere down the line.lol

thanks alot mate
"installed"

class101
11-14-2007, 05:49 AM
wow I was about to miss this awesome hack, thanks again bobster

class101
11-14-2007, 08:21 AM
I'm also getting the same error some users mentionned also


Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/vba_cmps_include_template.php on line 47

class101
11-14-2007, 09:20 AM
ok I have found how to fix this error ,

you should include cmps files before the vb global one

that way:

chdir('../');

$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array();

require_once(getcwd().'/includes/vba_cmps_include_template.php');
require_once(getcwd().'/includes/vba_cmps_global.php');
require_once(getcwd().'/global.php');

Gaetan
11-14-2007, 09:39 AM
wooooooooow i love it Oo

thanks a lot !!

bobster65
11-14-2007, 12:22 PM
Hey Guys.... there is a newer version of this here:

AJAX Tabs Content Script v2
https://vborg.vbsupport.ru/showthread.php?t=161197

It has the same features as this one, but with some added functionality that you might be interested in.

class101
11-14-2007, 12:35 PM
yup I have seen it but Im looking yet at another method you can try on vbseo.com homepage, it uses Adobe Spry (http://livedocs.adobe.com/en_US/Spry/1.4/help.html?content=WSFD7287A9-3B1C-4d49-9EAD-CB581B7BB71F.html)

Interesting code, you may look it to update your addon

bobster65
11-14-2007, 12:56 PM
yup I have seen it but Im looking yet at another method you can try on vbseo.com homepage, it uses Adobe Spry (http://livedocs.adobe.com/en_US/Spry/1.4/help.html?content=WSFD7287A9-3B1C-4d49-9EAD-CB581B7BB71F.html)

Interesting code, you may look it to update your addon

Sweet... you would implement it pretty close to the same way. Bookmarking it to test things out soon :cool:

class101
11-14-2007, 05:35 PM
with Spry my tabexternal.php is in the /modules/ directoy


<?php

$includetab1 .= '<table cellspacing="2" cellpadding="0" width=100%><tr> <td class="alt2"><span class="smallfont">Welcome Back To SITE NAME&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></table>';

eval('$home["$mods[modid]"][\'content\'] .= "' . fetch_template('adv_portal_Tab_Block_Main') . '";');
?>

The adv_portal_Tab_Block_Main looks like:


<script type="text/javascript" src="http://WEBSITE.com/forums/tabs/ajaxtabs.js"></script>

<div id="TabbedPanels1" class="TabbedPanels" style="padding-bottom:$vba_style[portal_vspace]px" >
<ul class="TabbedPanelsTabGroup">
<li class="TabbedPanelsTab" tabindex="0">Tab 1</li>
<li class="TabbedPanelsTab" tabindex="0">Tab 2</li>
<li class="TabbedPanelsTab" tabindex="0">Tab 3</li>
<li class="TabbedPanelsTab" tabindex="0">Tab 4</li>
</ul>



<div class="TabbedPanelsContentGroup">
<div class="TabbedPanelsContent">$includetab1</div>
<div class="TabbedPanelsContent">$includetab2</div>
<div class="TabbedPanelsContent">$includetab3</div>
<div class="TabbedPanelsContent">$includetab4</div>
</div>

</div>

<script type="text/javascript">
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
</script>


then create the php module, selecting tabexternal.php and name the template it will use :)
havent tested to add much tabs yet but I guess you can add them in the same tabexternal.php file then.

bobster65
11-14-2007, 05:45 PM
Cool Beans! I'm playing around with their Slider & Accordian Stuff... works pretty slick.

class101
11-15-2007, 08:12 AM
looks like working so to define the tabbed module for example as a homepage's template, then you define unique locations in the cmps options that are locations of differents tabs, then you can choose to display for example recent threads within the Tabbed module defined as a homepage , that way you quickly add others modules within tabs without so much php editing :)

turkforum
11-15-2007, 08:25 AM
looks like working so to define the tabbed module for example as a homepage's template, then you define unique locations in the cmps options that are locations of differents tabs, then you can choose to display for example recent threads within the Tabbed module defined as a homepage , that way you quickly add others modules within tabs without so much php editing
Reply With Quote

I am kind a comfused.. :) Can you explain us these step by step?
Especially in this step, vBa CMPS> Add Page > Template Page, How do we do it?
+
I did modify my ajax tabs and I am facing with strange problems like recent threads of my forums loads on firefox but not on IE..Here is the example of it..
http://www.turkforum.net/pasali.php?pageid=turkforum

class101
11-15-2007, 12:30 PM
Ha yeah I see you used to try the bobster script , me Im talking about the Adobe Spry script wich looks like same as this one but with much documentation and samples

https://www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5Fspry

you register for free and you dl Spry 1.6 and inside the Widget folder there is another folder "TabbedPanels" all is inside but let me know if it is of interest I can take the time to write the small tut how implementing Spry TabbedPanels + cmps, I'm able to choose any modules now to be displayed in tabs without any php edit with my method.

Screenshot(the 2 red areas are from the news module imported into the tab1):

https://vborg.vbsupport.ru/external/2007/11/34.jpg

turkforum
11-23-2007, 07:51 AM
Class, thank you for showing an alternative way to use tabs..:)
In your system I have some questions..
1.As you might know with ajax system, we decrease the server loads by reducing query calls..For example, my cmps main page calls 10 quries to load with ajax..If I do it by your system,all tabbeb content will be called in same time and will it increase quries in total? (not ajax but kind a dhtml type)

2.Can we create more than one tab system in one page? Like below..

1 2 3 4 > tabs X
content by numbers of tabs X
A B C D > tabs y
content by alphabets of tabs Y

thank you..:)

Alfa1
12-07-2007, 02:12 PM
AJAX TABS version 2.0 is now available as the primary option of this thread.... please review the new information as released today.

Version 1.0 information has been moved into the 2nd post of this thread for historical purposes as well as reference for those that have installed.

Thanks.. Bobster
Just a heads up: The 1st post says version 1, while the 2nd post says version 1.5. Where is version 2?

I have installed the version in the 1st post and am getting this error:
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/vba_cmps_include_template.php on line 47

EDIT: I found version 2 here: https://vborg.vbsupport.ru/showthread.php?t=161197

bobster65
12-07-2007, 02:26 PM
Just a heads up: The 1st post says version 1, while the 2nd post says version 1.5. Where is version 2?

I have installed the version in the 1st post and am getting this error:


EDIT: I found version 2 here: https://vborg.vbsupport.ru/showthread.php?t=161197

ya, just remark out or remove that line. sorry for the confusion.

voter
12-13-2007, 05:01 PM
ok I have found how to fix this error ,

you should include cmps files before the vb global one

that way:

chdir('../');

$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array();

require_once(getcwd().'/includes/vba_cmps_include_template.php');
require_once(getcwd().'/includes/vba_cmps_global.php');
require_once(getcwd().'/global.php');
Greate, thanks I was having same stuff, now it is gone

TCE Killa
01-24-2008, 02:39 PM
I have done everything but I don't know how to create a new CMPS Template Module. I'm using vB 3.6.8. If you can help, I'd highly appreciate it, thanks.

bobster65
01-24-2008, 02:49 PM
I have done everything but I don't know how to create a new CMPS Template Module. I'm using vB 3.6.8. If you can help, I'd highly appreciate it, thanks.

CMPS aka vbadvanced (www.vbadvanced.com) is a vbulletin addon.

If you do not have vbadvanced installed, you can still use this on a custom vB page by creating a template instead of a CMPS template module..

TCE Killa
01-24-2008, 09:02 PM
Thanks alot man.

ColdSpirit
01-27-2008, 12:33 PM
This is very confusing for "noobs"...

Can you explain step by step how to install this on CMPS (like add templates, add pages, add modules?)

From step 4 i cannot go further.... CPMS is so confuse to creade modules, pages, templates, etc...

Thank you in advance,
ColdSpirit

CoffeeToki
02-22-2008, 10:43 PM
Hi~ :) When I tried testing this...
I only get a list of links that say:


* Tab 1
* Tab 2
* Tab 3
* Tab 4

Congrats, AJAX Tabbed Content is working on your site!

Any ideas, what I've done wrong? I did follow the instructions. Made a new template, new module (template type), and so forth. Feel free to PM me if you wish. ^__^

bobster65
02-22-2008, 10:56 PM
Hi~ :) When I tried testing this...
I only get a list of links that say:


* Tab 1
* Tab 2
* Tab 3
* Tab 4

Congrats, AJAX Tabbed Content is working on your site!

Any ideas, what I've done wrong? I did follow the instructions. Made a new template, new module (template type), and so forth. Feel free to PM me if you wish. ^__^

Check to make sure that the path to the .ccs file in the template is correct. Not finding the .css file does that.

btw, not to confuse you or throw another bag of worms into the picture, but I did release a newer version (Version 2.0) of this not to long ago that has more features..... there is also a support thread at vBa site. here is the link https://vborg.vbsupport.ru/showthread.php?t=161197

CoffeeToki
02-22-2008, 11:11 PM
WooooOoO~ ^___^ Yes, it turns out I needed to give the FULL path name, and not just start from "/forums/...blah blah..." Silly me~!

And I'll look forward to working with the second version. Thank you very much for your quick reply and help! :) Hurray!

bobster65
02-22-2008, 11:18 PM
WooooOoO~ ^___^ Yes, it turns out I needed to give the FULL path name, and not just start from "/forums/...blah blah..." Silly me~!

And I'll look forward to working with the second version. Thank you very much for your quick reply and help! :) Hurray!

No Problem, glad you got it working :cool: In the Version 2.0 thread, in post #3, there are some additional enhance content files.. the newest release of recents threads is much better than the default one that is in this package (just so you know).. AND, it will work just fine with this.. all you would need to do is download recentthreadsexp2.php and you can use it with this version.

CoffeeToki
02-22-2008, 11:35 PM
Wow~ I just checked it out and installed them! :) Awesomeness to the Max! ^__^ Thanks, again! (Runs off to play with the CSS and customize!)

davewmack
04-23-2008, 05:49 PM
is there any way to add the rotate function to this?

bobster65
04-23-2008, 06:01 PM
is there any way to add the rotate function to this?

I released version 2 of this here: https://vborg.vbsupport.ru/showthread.php?t=161197

It has the rotation ability..

bartek24m
06-17-2008, 07:05 PM
hello i have a question
how can i change the ordering show list of threads

i would like to see the last 10 threads insted of the last 10 replay....


Coud you explain me how to turn Default Sort Field by Thread start Time ?



if ($_GET['content'] == 2) {

echo'<table cellspacing="2" cellpadding="0" width=100%><tr> <td class="thead" width="50%">Tytuł - Data - Odpowiedzi</td></tr>';

$recthread_tempname = 'exp';

if ($recthread_tempname == 'exp')
{
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_recthreads_exp_head') . '";');

$mods['colspan'] = 4;

if ($mod_options['portal_threads_lastpost'])
{
$mods['colspan']++;
}

if ($mod_options['portal_threads_showforum'])
{
$mods['colspan']++;
}
}

$vba_threads_condition = '';

// Threads & forums
if (!empty($mod_options['portal_threadids']) AND is_array($mod_options['portal_threadids']))
{
$vba_threads_condition = 'AND (thread.threadid IN(' . 16 . ')';
}
if (!empty($mod_options['portal_threads_forumids']) AND is_array($mod_options['portal_threads_forumids']))
{
$mods['inforums'] = $mod_options['portal_threads_forumids'];

if ($mod_options['portal_applypermissions'])
{
$mods['inforums'] = array_diff($mods['inforums'], $adv_canviewforums);
}
if (empty($mods['inforums']))
{
if (empty($mod_options['portal_threadids']))
{
$mods['nodisplay'] = true;
}
}
else
{
$vba_threads_condition .= iif(!empty($mod_options['portal_threadids']), ' OR thread', ' AND (thread') . '.forumid IN(' . 16 . ')';
}
}

// Add ) if we had forum or thread ids
if ($vba_threads_condition)
{
$vba_threads_condition .= 'AND (thread.threadid IN(' . 16 . ')';
}

if (!$mods['inforums'] AND !empty($adv_canviewforums) AND $mod_options['portal_applypermissions'])
{
$vba_threads_condition .= ' AND thread.forumid NOT IN(' . implode(',', $adv_canviewforums) . ')';
}

$show['lastpost'] = $mod_options['portal_threads_lastpost'];

if (!$mods['nodisplay'])
{
if ($mod_options['portal_threads_orderby'] == 'dateline')
{
$mod_options['portal_threads_orderby'] = 'thread.dateline';
}

if (!$mod_options['portal_threads_orderby'])
{
$mod_options['portal_threads_orderby'] = 'lastpost';
}
if (!$mod_options['portal_threads_direction'])
{
$mod_options['portal_threads_direction'] = 'DESC';
}

$markinglimit = (TIMENOW - ($vbulletin->options['markinglimit'] * 86400));

// Rating
$oldforumratings = $foruminfo['allowratings'];
$foruminfo['allowratings'] = $mod_options['portal_threads_showrating'];

$rtrating_fields = '';
if ($mod_options['portal_threads_showrating'] OR $mod_options['portal_threads_orderby'] == 'voteavg')
{
$rtrating_fields = 'IF(votenum >= ' . $vbulletin->options['showvotes'] . ', votenum, 0) AS votenum, IF(votenum >= ' . $vbulletin->options['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg, votetotal,';
}

$rthread_fields = '';
$rthread_join = '';

// Subscriptions
if ($mod_options['portal_threads_showsubscribed'] AND $vbulletin->userinfo['userid'])
{
$rthread_fields .= ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed';
$rthread_join .= ' LEFT JOIN ' . TABLE_PREFIX . 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = ' . $vbulletin->userinfo['userid'] . ')';
}

// Thread Icon
if ($mod_options['portal_threads_showicon'])
{
$rthread_fields .= ', thread.iconid AS threadiconid, iconpath AS threadiconpath';
$rthread_join .= ' LEFT JOIN ' . TABLE_PREFIX . 'icon AS icon ON (icon.iconid = thread.iconid)';
}

// Preview
if ($mod_options['portal_threads_showpreview'] AND $vbulletin->options['threadpreview'])
{
$rthread_fields .= ', post.pagetext AS preview';
$rthread_join .= ' LEFT JOIN ' . TABLE_PREFIX . 'post AS post ON (post.postid = thread.firstpostid)';
}

// Database read marking
if ($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
{
$rthread_fields .= ', threadread.readtime AS threadread';
$rthread_join .= ' LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')
LEFT JOIN ' . TABLE_PREFIX . 'forumread AS forumread ON (thread.forumid = forumread.forumid AND forumread.userid = ' . $vbulletin->userinfo['userid'] . ')';
}

// Attach paperclip
if ($mod_options['portal_threads_showpaperclip'])
{
$rthread_fields .= ', thread.attach';
}

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

$threads = $db->query_read("
SELECT $rtrating_fields thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, thread.lastpostid, pollid, thread.forumid, thread.open, sticky
$rthread_fields
FROM " . TABLE_PREFIX . "thread as thread
$rthread_join
WHERE open != 10
AND thread.visible = 1 " .
iif($mod_options['portal_threads_cutoffdate'],
'AND thread.lastpost > ' . (TIMENOW - $mod_options['portal_threads_cutoffdate'] * 86400)
) .
iif($ignusers,
' AND thread.postuserid NOT IN(' . $ignusers . ')'
) . "
AND thread.forumid=198 OR thread.forumid=197
ORDER BY $mod_options[portal_threads_orderby] $mod_options[portal_threads_direction]
LIMIT 10
");
$mods['threadcount'] = $db->num_rows($threads);

if ($mods['threadcount'])
{
require_once(DIR . '/includes/functions_forumdisplay.php');

if ($mod_options['portal_threads_multipage'])
{
$vbulletin->templatecache['threadbit_pagelink'] = str_replace(
'"$address"',
'"' . $vbulletin->options['bburl'] . '/$address"',
$vbulletin->templatecache['threadbit_pagelink']
);
}

// Table cell classes
$bgclass = 'alt1';

if ($show['lastpost'])
{
// Don't need a variable since it's after a known class, just switch
exec_switch_bg();
}

if ($mod_options['portal_threads_replies'])
{
$class_reply = exec_switch_bg();
}

if ($mod_options['portal_threads_views'])
{
$class_view = exec_switch_bg();
}

if ($mod_options['portal_threads_showforum'])
{
$class_ftitle = exec_switch_bg();
}

$recthreads_comma = '';
if ($mod_options['portal_threads_views'] AND $mod_options['portal_threads_replies'])
{
$recthreads_comma = ', ';
}
}

while ($thread = $db->fetch_array($threads))
{
$bgclass = exec_switch_bg();

if (!($adv_forumperms[$thread['forumid']] & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
{
$thread['preview'] = '';
}
else
{
// The vB preview function can be intensive w/ long strings, so let's try to save some overhead
$thread['preview'] = substr($thread['preview'], 0, ($vbulletin->options['threadpreview'] * 10));
}

// Trim title
if (strlen($thread['title']) > $mod_options['portal_threads_maxchars'] AND $mod_options['portal_threads_maxchars'])
{
$thread['title'] = fetch_trimmed_title($thread['title'], $mod_options['portal_threads_maxchars']);
}

// Check for long words that may stretch the page
if ($mod_options['portal_threads_maxwordchars'])
{
$thread['titlecheck'] = explode(' ', $thread['title']);

if (!empty($thread['titlecheck']))
{
$thread['title'] = '';

foreach ($thread['titlecheck'] AS $key => $word)
{
if (!$thread['titletrimmed'])
{
if (strlen($word) > $mod_options['portal_threads_maxwordchars'])
{
$word = fetch_trimmed_title($word, $mod_options['portal_threads_maxwordchars']);
$thread['titletrimmed'] = true;
}

if ($thread['title'])
{
$thread['title'] .= ' ';
}

$thread['title'] .= $word;
}
}
}
}

// Thread read marking
if ($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
{
if ($thread['threadread'] < $thread['forumread'])
{
$thread['threadread'] = $thread['forumread'];
}
}
else if (!$vb_read_cookies[$thread['forumid']])
{
$vb_read_cookies[$thread['forumid']] = max(fetch_bbarray_cookie('forum_view', $thread['forumid']), $markinglimit);
}

if (!$thread['threadread'] AND $vb_read_cookies[$thread['forumid']] > $thread['lastpost'])
{
$thread['threadread'] = TIMENOW;
}
else
{
$thread['threadread'] = '-1';
}

$thread = process_thread_array(
$thread,
$thread['threadread'],
$mod_options['portal_threads_showicon']
);

// Rating
$thread['rating'] = intval(round($thread['voteavg']));

($hook = vBulletinHook::fetch_hook('vba_cmps_module_recthre adsbits')) ? eval($hook) : false;

eval('$home["$mods[modid]"][\'content\'] .= "' . fetch_template('adv_portal_recthreads_exp') . '";');

// define('BR', '<'.'BR'.'>');
// echo "{$thread['title']}".BR;
// echo "by: {$thread['postusername']}".BR;
// echo "{$thread[postdate]}" . " " . "{$thread[posttime]}".BR;
// echo BR;

echo '<tr> <td class="alt1" class="smallfont">&raquo;&nbsp;<a href="http://www.clubbers.pl/showthread.php?t=' . $thread[threadid] . '"title="' . $thread[preview] . '">' . $thread[title] . '</a> <span class="smallfont">&nbsp;&nbsp;&nbsp;' . $thread[postdate] . '&nbsp;' . $thread[posttime] . '&nbsp;-&nbsp;' . $thread[replycount] . '&nbsp;Komentarzy</span></td></tr>';



}
}

$tabstring = $thread;


$db->free_result($threads);
unset($thread);

$foruminfo['allowratings'] = $oldforumratings;

if (!$mods['threadcount'] OR $mods['nodisplay'])
{
$show['tablerow'] = true;
if ($mods['modcol'] == 1)
{
$home["$mods[modid]"]['content'] = construct_phrase($vbphrase['no_x_to_display'], $vbphrase['threads']);
}
else
{
$home["$mods[modid]"]['content'] = construct_phrase($vbphrase['no_x_to_display'], $vbphrase['threads']);
}
}

//}

echo "</table>";



}


if ($_GET['content'] == 3) {

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




Thank you for help

chiptz
09-03-2008, 04:42 PM
great release, however i am not able to install it without vbadvanced, does anyone have this working only with vB?

bobster65
09-03-2008, 05:27 PM
great release, however i am not able to install it without vbadvanced, does anyone have this working only with vB?

Ya, if you want it running on say the FORUM HOME

Add this block of code to the HEADINCLUDE Template

<link rel="stylesheet" type="text/css" href="ajaxtabs/ajaxtabs.css" />
<script type="text/javascript" src="ajaxtabs/ajaxtabs.js">
/***********************************************
* Ajax Tabs Content script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>

Then add this block of code to the FORUMHOME Template where ever you wish to have to displayed.. ie before <!-- MAIN if you want it above the Forums) ..

<div id="ajaxcontentarea" style="border:1px solid gray; width:100%; height: 400px; background-color: white; padding: 2px">
</div>

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

<script type="text/javascript">
var mytabs=new ddajaxtabs("maintab", "ajaxcontentarea")
mytabs.setpersist(true)
mytabs.setselectedClassTarget("link") //"link" or "linkparent"
mytabs.init()
</script>

chiptz
09-07-2008, 11:28 AM
Hi,

Thank you for your help! however maybe I was not clear, will this work without cmps installed?

I always get this:

Warning: require_once(./includes/vba_cmps_include_template.php) [function.require-once]: failed to open stream: No such file or directory in [path]/tab_blog.php on line 25

Fatal error: require_once() [function.require]: Failed opening required './includes/vba_cmps_include_template.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/techzone/public_html/dev/forum/tab_blog.php on line 25

bobster65
09-07-2008, 03:20 PM
Hi,

Thank you for your help! however maybe I was not clear, will this work without cmps installed?

I always get this:

Warning: require_once(./includes/vba_cmps_include_template.php) [function.require-once]: failed to open stream: No such file or directory in [path]/tab_blog.php on line 25

Fatal error: require_once() [function.require]: Failed opening required './includes/vba_cmps_include_template.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/techzone/public_html/dev/forum/tab_blog.php on line 25

ya, forgot to mention that you simply strip that that out (the include at the top of each of those content files)...