Thread: Add-On Releases - AJAX Tabs Content Script v2
View Single Post
  #3  
Old 10-26-2007, 06:00 PM
bobster65's Avatar
bobster65 bobster65 is offline
 
Join Date: Mar 2006
Location: Montana
Posts: 1,169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Enhanced Recent Threads Layout

See this post - >> https://vborg.vbsupport.ru/showpost....5&postcount=29


** 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)

Member Submitted Enhancements:

Date - Attachment name - Description - Member Name

NEW GARS 02-07-2008 - https://vborg.vbsupport.ru/showpost....&postcount=113 - GARS Content File - ZiG


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

?>


...
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01662 seconds
  • Memory Usage 1,874KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete