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"> Views </td><td class="thead" width="20%" align="left">Forum</td></tr>';
find:
Code:
// echo BR;
echo '<tr> <td class="alt1" class="smallfont">» <a href="http://www.DOMAIN.COM/forums/showthread.php?t=' . $thread[threadid] . '"title="' . $thread[preview] . '">' . $thread[title] . '</a> <br><span class="smallfont"> ' . $thread[postdate] . ' ' . $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">» <a href="/forums/showthread.php?t=' . $thread[threadid] . '"title="' . $thread[preview] . '">' . $thread[title] . '</a><div style="font-size:10px"> ' . $thread[postusername] . '</div></td>';
echo '<td class="alt1 smallfont" align="right">' . $thread[lastpostdate] . ' <span class="time">' . $thread[lastposttime] . ' </span><div> <span style="font-size:10px">by ' . $thread[lastposter] . ' <a href="/forums/showthread.php?p=' . $thread[lastpostid] . '#post' . $thread[lastpostid] . '"></span><strong>»</strong></a> </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"> <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">» <a href="/forums/showthread.php?t=' . $thread[threadid] . '"title="' . $thread[preview] . '">' . $thread[title] . '</a><div style="font-size:10px"> ' . $thread[postusername] . '</div></td>';
replace with:
Code:
if ($show['gotonewpost'])
{
echo '<td class="alt1 smallfont"><a href="/forums/showthread.php?t=' . $thread[threadid] . '&goto=newpost">∇</a> <a href="/forums/showthread.php?t=' . $thread[threadid] . '"title="' . $thread[preview] . '"><strong>' . $thread[title] . '</strong></a><div style="font-size:10px"> ' . $thread[postusername] . '</div></td>';
}
else
{
echo '<td class="alt1 smallfont">» <a href="/forums/showthread.php?t=' . $thread[threadid] . '"title="' . $thread[preview] . '">' . $thread[title] . '</a><div style="font-size:10px"> ' . $thread[postusername] . '</div></td>';
}
clicking the arrow will take you to the first new post.