Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2002
Posts: 193
Member
Member
Offline
Joined: Mar 2002
Posts: 193
How can I remove both options from my board?

1. Threaded.

Removing showthreaded.php and removing threaded-view links from templates - would that do the trick? Also setting the default display mode for users to 'flat view' in phpadmin and then removing this option from the editdisplay.php file. Could someone guide me through the steps?

2. Expanded view

Setting default view to collapsed for all users and removing the option from the same file as above. What else needs to be done to prevent this function from being used?

I understand that after making such changes the board will still function normally (albeit without the threaded/expanded view) and that the way posts are stored in the db will not change (structure).

I could really do with removing these functions from my board. I'm just hoping that the structure of the db remains the same so that this won't have any effect on the upcoming export/import to the new UBB product.

Sponsored Links
Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
You pretty much nailed it. Step one would be to remove the references from the templates, this would keep most users from using the option.

Step two would be to set everyone to flat view default (and they now cannot change it back).

Last, re-name the file showthreaded.php.

No database structure changes necessary

Joined: Mar 2002
Posts: 193
Member
Member
Offline
Joined: Mar 2002
Posts: 193
Righto! Would love to give it a try - it'll probably be the first hack that I've ever done, so my fingers are a bit shaky given that this isn't exactly a routine operation...

1. I've alreade removed showthreaded.php from the site. Which files contain references to this - is it only showthreaded.php? And which command/s must I remove to carry out this procedure?

Lastly, what must I remove from editdisplay.php to finish off the job, and what MySQL query must I run to set everyone's default to 'Threaded mode'?

----------

2. Is it only postlist.php that needs to be altered? What must I slice out?

And as above, what must I remove from editdisplay.php and which MySQL query should I use to set the default to 'Collapsed Topics'.

Joined: Mar 2002
Posts: 193
Member
Member
Offline
Joined: Mar 2002
Posts: 193
Dudes, can someone give me a few hints so that I can give this a try?

Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
Well, it boils down to what Medar said above - remove the links to threaded mode from the postlist and showflat templates, and remove the option from the dropdown in editdisplay. Then update everyone to use flat mode in the database. This is all template stuff, not code work.

Don't actually remove showthreaded, as there may still be links to it elsewhere, and you don't want those to break.

Last edited by Charles Capps; 12/09/2004 2:36 PM.

UBB.classic: Love it or hate it, it was mine.
Sponsored Links
Joined: Mar 2002
Posts: 193
Member
Member
Offline
Joined: Mar 2002
Posts: 193
Many thanks!! Just a few quick questions as I haven't done any code-removing before... I understand that there are three files to edit and one MySQL query to run:

1. postlist.php

What should I remove from this file? I see a few references to threaded in this file:

Code
// Do we link to showthreaded or showflat <br />if (!$mode) { <br />	$mode = $theme['postlist']; <br />} <br />$mode = "show$mode";


-----

Code
// If $view isn't set then it gets set to the default view <br />if ( (empty($view)) && ($userview) ) { <br />	$view = $user['U_View']; <br />} <br />elseif ( (empty($view)) && (!$userview) ) { <br />	$view = $theme['threaded']; <br />}


-----

Code
// If $postlist is threaded then we need to give them the proper <br />// button to expand or collapse the threads <br />$changestart = ""; <br />$changestop  = ""; <br />$changealt = ""; <br />if ($view == "collapsed") { <br />	$changestart = "<a href=\"{$config['phpurl']}/postlist.php?Cat=$Cat&amp;Board=$Board&amp;page=$page&amp;view=expanded\">"; <br />	$changestop = "</a>"; <br />	$changeoption = "expand.gif"; <br />	$changetext = $ubbt_lang['EXP_ICON']; <br />	$changealt = $ubbt_lang['TEXT_EXP']; <br />} <br />else { <br />	$changestart = "<a href=\"{$config['phpurl']}/postlist.php?Cat=$Cat&amp;Board=$Board&amp;page=$page&amp;view=collapsed\">"; <br />	$changestop = "</a>"; <br />	$changeoption = "collapse.gif"; <br />	$changetext = $ubbt_lang['COL_ICON']; <br />	$changealt = $ubbt_lang['TEXT_COLL']; <br />} <br /> <br />if ( ($config['dateslip']) && ($view != "expanded") ){ <br />	$datecolumn = $ubbt_lang['LAST_POST']; <br />} <br />else { <br />	$datecolumn = $ubbt_lang['POSTON_TEXT']; <br />}


-----

And lastly the section that starts with:

// If we are not doing flat posts and the view is expanded then we
// will list all the replies out in a threaded format


2. showflat.php

I see one reference to showthreaded.php here but wouldn't want to start slicing stuff out without getting the green light as to exactly what needs to be removed:
Code
 <br />} <br />		$postrow[$rownum]['replyto'] = "[Re: <a href=\"{$config['phpurl']}/showthreaded.php{$var_start}Cat{$var_eq}$Cat{$var_sep}Number{$var_eq}{$postrow[$rownum]['ParentPost']}{$var_sep}page{$var_eq}$page{$var_sep}vc{$var_eq}1\" target=\"_new\" title=\"[Re: #{$postrow[$rownum]['ParentPost']}]\" alt=\"[Re: #{$postrow[$rownum]['ParentPost']}]\"> {$parentarray[$rowparent]}</a>]"; <br />	} <br />


3. editdisplay.php

Code
// Predefine some variables <br />$defselected = ""; <br />$nopictureview = ""; $yespictureview = ""; <br />$categories = ""; $mi = ""; $cp = ""; <br />$default = ""; $d1 = ""; $d2 = ""; $w1 = ""; $w2 = ""; $w3 = ""; $m1 = ""; $m3 = ""; $m6 = ""; $y1 = ""; $allofthem = ""; <br />$DS = ""; $AS = ""; $DP = ""; $AP = ""; $AD = ""; $DD = ""; <br />$flat = ""; $threaded = ""; <br />$expanded = ""; $collapsed = "";


-----

// Find out if they already have a display preference
if($Display == "flat") { $flat = "selected="selected""; };
if($Display == "threaded") { $threaded = "selected="selected""; }

-----

// Find out if they have a view preference
if($View == "collapsed") { $collapsed = "selected="selected""; }
if($View == "expanded") { $expanded = "selected="selected""; }

I'd like to set the preferences to a) flat -and- b) collapsed, what MySQL queries need to be run to set those for all users? Also, what should I remove from this file beforehand so that people can't alter these settings - should I simply erase all these lines completely (the last two parts that is) before/after running the queries?

On a side not, I'd also like to get rid of the Expand option from the templates, maybe once I cut out 'threaded mode' then someone could kindly help me get rid of 'expanded view' as well?

Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
Don't even touch the .php files.

These are changes that only need to be made in the templates, and I am always a fan of commenting something 'out' rather than removing it (makes it easier to fix).

Change your templates and remove the shotthreaded options, and you will be fine.

Joined: Mar 2002
Posts: 193
Member
Member
Offline
Joined: Mar 2002
Posts: 193
If anyone has the time I would really appreciate some detailed info about the exact changes I need to make to the templates.

Joined: Mar 2002
Posts: 193
Member
Member
Offline
Joined: Mar 2002
Posts: 193
Fellas, does anyone have detailed info on what I need to comment out in the templaces?

Would love to see how things run without threaded/expand slowing me down.

Might also be useful for others who are on shared systems or who are also having trouble with system resources.

Joined: Mar 2002
Posts: 193
Member
Member
Offline
Joined: Mar 2002
Posts: 193
Come on fellas', Christmas is coming! Someone please be kind enough to guide me through this step by step...

Sponsored Links
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
You'll have to edit:

templates/default/postlist.tmpl (remove the link to expanded view in the table at the top)
templates/default/showflat.tmpl (remove the link to showthreaded.php at the top and bottom of the file

templates/default/editdisplay.tmpl (remove the two select boxes)




Open showthreaded.php

Search for:
$activethread = "";
$PNumber = "";

Insert before:

header("Location: {$config['phpurl']}/showflat.php{$var_start}Cat{$var_eq}$Cat{$var_sep}Number{$var_eq}$Number{$var_sep}an{$var_eq}$an{$var_sep}page{$var_eq}$page{$var_sep}vc{$var_eq}1");


This will redirect all requests from showthreaded.php to showflat.php



Open changedisplay.php

Search for:
$timeformat = get_input("timeformat","post");
$profilehash = get_input("profilehash","post");

Insert below:
$view = "collapsed";
$display = "flat";

Run SQL query to set preferences off all users to flat and collapsed view:
Update w3t_Users SET U_Display = "flat", U_View="collapsed";


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
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 254
Joined: January 2000
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)