Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
What is it?: A mod that will remove the edit, reply, and quote hyperlinks if the viewer of a thread does not have reply access to the forum the thread is in.

Instructions attached. Mad props to Astaran for helping me debug the script

Version 1.1 Removes the edit button on a post by post bassis in showflat view.

Update: A more complete mod to remove dead navigation links from all of UBB Threads can be found here.
Attachments
72323-posting_buttons.txt (0 Bytes, 56 downloads)

Last edited by Dalantech; 03/18/2003 4:14 PM.
Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
I forgot my manners on this one: Props to Gardener for suggesting this mod while I was working on the article templates.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
nice one


- Allen wavey
- What Drives You?
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Thanks!

I'd like to see this one make it's way into the official Threads release.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
How do you get this to work if you have installed the Quick Reply hack?

Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
I don't think it would make any difference, since the script for the buttons shouldn't be effected by the quick reply hack.

If you want to know how to get rid of the quick reply box if someone doesn't have the right to post to a thread I can look into it for you.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
I've got it figured out. Here is what I did, since I have Quick Reply installed.

In showthreaded.tmpl I looked for:

[]
<table border="0" class="tablesurround">
<tr>
<td class="navigation">
$editlinkstart
<img src="{$config['images']}/edit.gif" border="0" alt="{$ubbt_lang['PEDIT_HEAD']}" $imagestyle />
{$ubbt_lang['EDIT_ICON']}
$editlinkstop
 
</td>
<td class="navigation">
$replylinkstart
<img src="{$config['images']}/reply.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" $imagestyle />
{$ubbt_lang['REPLY_ICON']}
$replylinkstop
 
</td>
<td class="navigation">
$quotelinkstart
<img src="{$config['images']}/quote.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" $imagestyle />
{$ubbt_lang['QUOTE_ICON']}
$quotelinkstop
 
</td>

<td class="navigation">
<a href="#quickreply">
<img src="{$config['images']}/reply.gif" border="0" alt="{$ubbt_lang['QUICK_REPLY']}" $imagestyle />
{$ubbt_lang['QUICK_REPLY']}
</a>
 
</td>

</tr>
</table>
[/]
and replaced it with:
[]
UBBTPRINT;

//---------------
// Post, Edit, and Reply link start

if ($edit == "on") {

echo <<<UBBTPRINT


<table border="0" class="tablesurround">
<tr>
<td class="navigation">
$editlinkstart
<img src="{$config['images']}/edit.gif" border="0" alt="{$ubbt_lang['PEDIT_HEAD']}" $imagestyle />
{$ubbt_lang['EDIT_ICON']}
$editlinkstop
 
</td>
<td class="navigation">
$replylinkstart
<img src="{$config['images']}/reply.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" $imagestyle />
{$ubbt_lang['REPLY_ICON']}
$replylinkstop
 
</td>
<td class="navigation">
$quotelinkstart
<img src="{$config['images']}/quote.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" $imagestyle />
{$ubbt_lang['QUOTE_ICON']}
$quotelinkstop
 
</td>

<td class="navigation">
<a href="#quickreply">
<img src="{$config['images']}/reply.gif" border="0" alt="{$ubbt_lang['QUICK_REPLY']}" $imagestyle />
{$ubbt_lang['QUICK_REPLY']}
</a>
 
</td>

</tr>
</table>

UBBTPRINT;

}
else {
if ($reply == "on") {

echo <<<UBBTPRINT

<table border="0" class="tablesurround">
<tr>
<td class="navigation">
$replylinkstart
<img src="{$config['images']}/reply.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" $imagestyle />
{$ubbt_lang['REPLY_ICON']}
$replylinkstop
 
</td>
<td class="navigation">
$quotelinkstart
<img src="{$config['images']}/quote.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" $imagestyle />
{$ubbt_lang['QUOTE_ICON']}
$quotelinkstop
 
</td>
<td class="navigation">
<a href="#quickreply">
<img src="{$config['images']}/reply.gif" border="0" alt="{$ubbt_lang['QUICK_REPLY']}" $imagestyle />
{$ubbt_lang['QUICK_REPLY']}
</a>
 
</td>
</tr>
</table>

UBBTPRINT;
}
}

//---------------
// Post, Edit, and Reply link stop

echo <<<UBBTPRINT
[/]

In showflat.tmpl I found:
[]
<table class="tablesurround" border="0">
<tr>
<td class="navigation" nowrap="nowrap">
{$postrow[$i]['editlinkstart']}
<img src="{$config['images']}/edit.gif" border="0" alt="{$ubbt_lang['PEDIT_HEAD']}" width="21" height="14" $imagestyle />
{$ubbt_lang['EDIT_ICON']}
{$postrow[$i]['editlinkstop']}
 
</td>
<td class="navigation" nowrap="nowrap">
{$postrow[$i]['replylinkstart']}
<img src="{$config['images']}/reply.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" width="27" height="14" $imagestyle />
{$ubbt_lang['REPLY_ICON']}
{$postrow[$i]['replylinkstop']}
 
</td>
<td class="navigation" nowrap="nowrap">
{$postrow[$i]['quotelinkstart']}
<img src="{$config['images']}/quote.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" width="27" height="14" $imagestyle />
{$ubbt_lang['QUOTE_ICON']}

UBBTPRINT;
if (($user['U_Username']) && (($Open != "C") && ($Open != "M"))) {
$qreplylinkstart = "<a href="javascript:quickreply('$i');">";
$qreplylinkstop = "</a>";
} else {
$qreplylinkstart = "";
$qreplylinkstop = "";
}
echo <<<UBBTPRINT
<td class="navigation" nowrap="nowrap">
$qreplylinkstart
<img src="{$config['images']}/reply.gif" border="0" alt="{$ubbt_lang['QUICK_REPLY']}" width="27" height="14" $imagestyle />
{$ubbt_lang['QUICK_REPLY_ICON']}
$qreplylinkstop
 
</td>
</tr>
</table>
[/]
and replaced it with:
[]
UBBTPRINT;

//---------------
// Post, Edit, and Reply link start

if ($postrow[$i]['editlinkstart'] != "") {

echo <<<UBBTPRINT


<table class="tablesurround" border="0">
<tr>
<td class="navigation" nowrap="nowrap">
{$postrow[$i]['editlinkstart']}
<img src="{$config['images']}/edit.gif" border="0" alt="{$ubbt_lang['PEDIT_HEAD']}" width="21" height="14" $imagestyle />
{$ubbt_lang['EDIT_ICON']}
{$postrow[$i]['editlinkstop']}
 
</td>
<td class="navigation" nowrap="nowrap">
{$postrow[$i]['replylinkstart']}
<img src="{$config['images']}/reply.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" width="27" height="14" $imagestyle />
{$ubbt_lang['REPLY_ICON']}
{$postrow[$i]['replylinkstop']}
 
</td>
<td class="navigation" nowrap="nowrap">
{$postrow[$i]['quotelinkstart']}
<img src="{$config['images']}/quote.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" width="27" height="14" $imagestyle />
{$ubbt_lang['QUOTE_ICON']}

UBBTPRINT;
if (($user['U_Username']) && (($Open != "C") && ($Open != "M"))) {
$qreplylinkstart = "<a href="javascript:quickreply('$i');">";
$qreplylinkstop = "</a>";
} else {
$qreplylinkstart = "";
$qreplylinkstop = "";
}
echo <<<UBBTPRINT
<td class="navigation" nowrap="nowrap">
$qreplylinkstart
<img src="{$config['images']}/reply.gif" border="0" alt="{$ubbt_lang['QUICK_REPLY']}" width="27" height="14" $imagestyle />
{$ubbt_lang['QUICK_REPLY_ICON']}
$qreplylinkstop
 
</td>
</tr>
</table>

UBBTPRINT;

}
else {
if ($reply == "on") {

echo <<<UBBTPRINT

<table class="tablesurround" border="0">
<tr>
<td class="navigation">
{$postrow[$i]['replylinkstart']}
<img src="{$config['images']}/reply.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" width="27" height="14" $imagestyle />
{$ubbt_lang['REPLY_ICON']}
{$postrow[$i]['replylinkstop']}
 
</td>
<td class="navigation">
{$postrow[$i]['quotelinkstart']}
<img src="{$config['images']}/quote.gif" border="0" alt="{$ubbt_lang['REPLY_POST']}" width="27" height="14" $imagestyle />
{$ubbt_lang['QUOTE_ICON']}
{$postrow[$i]['quotelinkstop']}
 
</td>
</tr>
</table>

UBBTPRINT;
}
}

//---------------
// Post, Edit, and Reply link stop

echo <<<UBBTPRINT
[/]

There is also the post button at the top of the postlist page that would be nice to get rid of too - to complete the removal hack. I have tried to get this to work, but alas, my PHP skills are meager. Here is what I've tried, but has not worked. Can someone tell me where I went wrong?

In postlist.tmpl I found:
[]
<table border="0" class="tablesurround">
<tr>
<td class="navigation" nowrap="nowrap">

<!-- postoption is either newpost.gif or greynewpost.gif -->
$newpoststart
<img src="{$config['images']}/$postoption" alt="{$ubbt_lang['MAKE_A_NEW']}" border="0" {$images['newpost']} $imagestyle />
{$ubbt_lang['NEW_POST_ICON']}
$newpoststop
 
</td>
<td class="navigation" nowrap="nowrap">
<!-- prevoption is either previous.gif or greyprevious.gif -->
$prevstart
<img src="{$config['images']}/$prevoption" alt="{$ubbt_lang['PREV_PAGE']}" border="0" {$images['previous']} $imagestyle />
{$ubbt_lang['PREV_ICON']}
$prevstop
 
</td>
<td class="navigation" nowrap="nowrap">
<a href="{$config['phpurl']}/ubbthreads.php?Cat=$Cat&C=$C">
<img src="{$config['images']}/all.gif" alt="{$ubbt_lang['FORUM_IND']}" border="0" {$images['all']} $imagestyle />
{$ubbt_lang['INDEX_ICON']}
</a>
 
</td>
<td class="navigation" nowrap="nowrap">
<!-- nextoption is either next.gif or greynext.gif -->
$nextstart
<img src="{$config['images']}/$nextoption" alt="{$ubbt_lang['NEXT_PAGE']}" border="0" {$images['next']} $imagestyle />
{$ubbt_lang['NEXT_ICON']}
$nextstop
 
</td>
<td class="navigation" nowrap="nowrap">
<!-- expandoption is either expand.gif or greyexpand.gif -->
$expandstart
<img src="{$config['images']}/$expandoption" alt="{$ubbt_lang['TEXT_EXP']}" border="0" {$images['expand']} $imagestyle />
{$ubbt_lang['EXP_ICON']}
$expandstop
 
</td>
<td class="navigation" nowrap="nowrap">
<!-- collapseoption is iether collapse.gif or greycollapse.gif -->
$collapsestart
<img src="{$config['images']}/$collapseoption" alt="{$ubbt_lang['TEXT_COLL']}" border="0" {$images['collapse']} $imagestyle />
{$ubbt_lang['COL_ICON']}
$collapsestop
 
</td>
</tr>
</table>
[/]
and replaced it with:
[]
UBBTPRINT;

//---------------
// Post link start

if ($post == "off") {

echo <<<UBBTPRINT


<table border="0" class="tablesurround">
<tr>
<td class="navigation" nowrap="nowrap">
<!-- prevoption is either previous.gif or greyprevious.gif -->
$prevstart
<img src="{$config['images']}/$prevoption" alt="{$ubbt_lang['PREV_PAGE']}" border="0" {$images['previous']} $imagestyle />
{$ubbt_lang['PREV_ICON']}
$prevstop
 
</td>
<td class="navigation" nowrap="nowrap">
<a href="{$config['phpurl']}/ubbthreads.php?Cat=$Cat&C=$C">
<img src="{$config['images']}/all.gif" alt="{$ubbt_lang['FORUM_IND']}" border="0" {$images['all']} $imagestyle />
{$ubbt_lang['INDEX_ICON']}
</a>
 
</td>
<td class="navigation" nowrap="nowrap">
<!-- nextoption is either next.gif or greynext.gif -->
$nextstart
<img src="{$config['images']}/$nextoption" alt="{$ubbt_lang['NEXT_PAGE']}" border="0" {$images['next']} $imagestyle />
{$ubbt_lang['NEXT_ICON']}
$nextstop
 
</td>
<td class="navigation" nowrap="nowrap">
<!-- expandoption is either expand.gif or greyexpand.gif -->
$expandstart
<img src="{$config['images']}/$expandoption" alt="{$ubbt_lang['TEXT_EXP']}" border="0" {$images['expand']} $imagestyle />
{$ubbt_lang['EXP_ICON']}
$expandstop
 
</td>
<td class="navigation" nowrap="nowrap">
<!-- collapseoption is iether collapse.gif or greycollapse.gif -->
$collapsestart
<img src="{$config['images']}/$collapseoption" alt="{$ubbt_lang['TEXT_COLL']}" border="0" {$images['collapse']} $imagestyle />
{$ubbt_lang['COL_ICON']}
$collapsestop
 
</td>
</tr>
</table>

UBBTPRINT;

}
else {

echo <<<UBBTPRINT

<table border="0" class="tablesurround">
<tr>
<td class="navigation" nowrap="nowrap">

<!-- postoption is either newpost.gif or greynewpost.gif -->
$newpoststart
<img src="{$config['images']}/$postoption" alt="{$ubbt_lang['MAKE_A_NEW']}" border="0" {$images['newpost']} $imagestyle />
{$ubbt_lang['NEW_POST_ICON']}
$newpoststop
 
</td>

<td class="navigation" nowrap="nowrap">
<!-- prevoption is either previous.gif or greyprevious.gif -->
$prevstart
<img src="{$config['images']}/$prevoption" alt="{$ubbt_lang['PREV_PAGE']}" border="0" {$images['previous']} $imagestyle />
{$ubbt_lang['PREV_ICON']}
$prevstop
 
</td>
<td class="navigation" nowrap="nowrap">
<a href="{$config['phpurl']}/ubbthreads.php?Cat=$Cat&C=$C">
<img src="{$config['images']}/all.gif" alt="{$ubbt_lang['FORUM_IND']}" border="0" {$images['all']} $imagestyle />
{$ubbt_lang['INDEX_ICON']}
</a>
 
</td>
<td class="navigation" nowrap="nowrap">
<!-- nextoption is either next.gif or greynext.gif -->
$nextstart
<img src="{$config['images']}/$nextoption" alt="{$ubbt_lang['NEXT_PAGE']}" border="0" {$images['next']} $imagestyle />
{$ubbt_lang['NEXT_ICON']}
$nextstop
 
</td>
<td class="navigation" nowrap="nowrap">
<!-- expandoption is either expand.gif or greyexpand.gif -->
$expandstart
<img src="{$config['images']}/$expandoption" alt="{$ubbt_lang['TEXT_EXP']}" border="0" {$images['expand']} $imagestyle />
{$ubbt_lang['EXP_ICON']}
$expandstop
 
</td>
<td class="navigation" nowrap="nowrap">
<!-- collapseoption is iether collapse.gif or greycollapse.gif -->
$collapsestart
<img src="{$config['images']}/$collapseoption" alt="{$ubbt_lang['TEXT_COLL']}" border="0" {$images['collapse']} $imagestyle />
{$ubbt_lang['COL_ICON']}
$collapsestop
 
</td>
</tr>
</table>

UBBTPRINT;

}

//---------------
// Post link stop

echo <<<UBBTPRINT
[/]
I'm pretty sure, maybe, that I didn't get the variable correct. Is $post correct? I tried all different variables including $newpost, $postoption, and I even got desperate and tried $newpoststart. What else is wrong with it? Lay it on me!



Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
I'd have to dig into postlist.php and figure out what variable to use for the check. Looking good on the quick reply

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Please see this mod. I've removed all of the possible dead links.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)