Thread: Add-On Releases - AJAX Tabs Content Script v2
View Single Post
  #34  
Old 11-08-2007, 08:32 AM
kennethj kennethj is offline
 
Join Date: Jan 2002
Location: USA - tn
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

couple of request for this - now its' here for those who need it, wish to use it .
these are just edits - thanks to the author of the mod

edits for AJAX Tabs Content Script v2 - vBulletin.org Forum

i use this for admin only right now -- so no demo , just images of what i see .

i am NOT a coder by no means - just figured it out for myself and .. .
am certainly no writer either .. .

in the template(s) provided from this mod :

adding more information to the new posts:

this uses all of the information i needed -
to remove unneeded fields both the sections must be edited.

the first from <td to </td for the top section (lables) and the second section (what it displays for each one), the entire line : echo '<td to /td>';

find:
Code:
echo '<table cellspacing="2" cellpadding="0" width=100%><tr> <td class="thead">Title - Date</td></tr>';
replace with :
Code:
echo '<table class="tborder" cellspacing="1" cellpadding="1" width="100%"><tr align="center"><td class="thead" width="48%" align="left">Title / Started by</td><td class="thead" width="28%">LastPost</td><td class="thead" width="4%">Replies</td><td class="thead" width="4%" nowrap="nowrap">&nbsp;Views&nbsp;</td><td class="thead" width="20%" align="left">Forum</td></tr>';
find:
Code:
                        // echo BR;

                        echo '<tr> <td class="alt1" class="smallfont">&raquo;&nbsp;<a href="http://www.DOMAIN.COM/forums/showthread.php?t=' . $thread[threadid] . '"title="' . $thread[preview] . '">' . $thread[title] . '</a> <br><span class="smallfont">&nbsp;&nbsp;&nbsp;' . $thread[postdate] . '&nbsp;' . $thread[posttime] . '</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>";
replace with :
Code:
                        // echo BR;

		echo '<tr>';

		echo '<td class="alt1 smallfont">&raquo;&nbsp;<a href="/forums/showthread.php?t=' . $thread[threadid] . '"title="' . $thread[preview] . '">' . $thread[title] . '</a><div style="font-size:10px">&nbsp; &nbsp;' . $thread[postusername] . '</div></td>';

		echo '<td class="alt1 smallfont" align="right">' . $thread[lastpostdate] . '&nbsp;<span class="time">' . $thread[lastposttime] . '&nbsp;</span><div> <span style="font-size:10px">by ' . $thread[lastposter] . ' <a href="/forums/showthread.php?p=' . $thread[lastpostid] . '#post' . $thread[lastpostid] . '"></span><strong>&raquo;</strong></a>&nbsp;</div></td>';

        echo '<td class="alt2 smallfont" align="center">' . $thread[replycount] . '</td>';

        echo '<td class="alt2 smallfont" align="center">' . $thread[views] . '</td>';

        echo '<td class="alt1 smallfont">&nbsp;<a href="/forums/forumdisplay.php?f=' . $thread[forumid] . '">' . $thread[forumtitle] . '</a></td>';
                 }
        }

$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 "</tr></table>";
the arrow on the last post takes you to the last post.

dont' forget to change the path to your forum : is at /forums now.


to trim the thread titles to a desired length:

find : near the top :
Code:
// #######################################################################


?>

<?php
add the 2 varables or replace the section with :
Code:
// #######################################################################

$portal_threads_maxchars = '33';
$portal_threads_maxwordchars = '15';

?>

<?php
find :
Code:
                        // 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;
                                                }
                                        }
                                }
                        }
replace with :
Code:
                        // Trim title
                        if (strlen($thread['title']) > $portal_threads_maxchars AND $portal_threads_maxchars)
                        {
                                $thread['title'] = fetch_trimmed_title($thread['title'], $portal_threads_maxchars);
                        }

						// Check for long words that may stretch the page
                        if ($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) > $portal_threads_maxwordchars)
                                                        {
                                                                $word = fetch_trimmed_title($word, $portal_threads_maxwordchars);
                                                                $thread['titletrimmed'] = true;
                                                        }

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

                                                        $thread['title'] .= $word;
                                                }
                                        }
                                }
                        }
are the same 2 settings as in the vBa CP.
$portal_threads_maxchars is for how many charters are displayed.
$portal_threads_maxwordchars is for how long words are.
change the 33 and 15 to your needs.


an attempt
thread marking for new: this works DIFFERENTLY than expected - how it should!
if it was in templates it may work correctly - for me it works untill i learn how to change things.

posts will show new untill you mark the forums read manualy - there may be other conditions, its' a start.
NO i can NOT change how this is working now or how it functions!!!
am using what i thought may work and .. . it dont'.


find:
Code:
		echo '<td class="alt1 smallfont">&raquo;&nbsp;<a href="/forums/showthread.php?t=' . $thread[threadid] . '"title="' . $thread[preview] . '">' . $thread[title] . '</a><div style="font-size:10px">&nbsp; &nbsp;' . $thread[postusername] . '</div></td>';
replace with:
Code:
 				if ($show['gotonewpost'])
 
 				{
			echo '<td class="alt1 smallfont"><a href="/forums/showthread.php?t=' . $thread[threadid] . '&amp;goto=newpost">&nabla;</a>&nbsp;<a href="/forums/showthread.php?t=' . $thread[threadid] . '"title="' . $thread[preview] . '"><strong>' . $thread[title] . '</strong></a><div style="font-size:10px">&nbsp; &nbsp;' . $thread[postusername] . '</div></td>';
                    }
                   else
                    {
		     echo '<td class="alt1 smallfont">&raquo;&nbsp;<a href="/forums/showthread.php?t=' . $thread[threadid] . '"title="' . $thread[preview] . '">' . $thread[title] . '</a><div style="font-size:10px">&nbsp; &nbsp;' . $thread[postusername] . '</div></td>';
					}
clicking the arrow will take you to the first new post.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01391 seconds
  • Memory Usage 1,825KB
  • 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
  • (10)bbcode_code
  • (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