Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Hi,

I am trying to set one or more forums to display in expanded view by default - overriding the preferences set sitewide and in the user preferences.

So far I have...

in main.inc.php

$config['view_expanded'] = "forum1,forum2,forum8"; //Enter forum keywords separated by a comma


in postlist.php

if (stristr(",{$config['view_expanded']},",",$Board_q,")) {
$view = "expanded";
}

just after we grab the board info.


This works fine, and displays the forum(s) in expanded view - so far so good

However.... If you click on '- collapse' on these forums, then despite &view=collapsed being in the address bar, the forum remains in expanded view.

How can I therefore set this up so that clicking on '- collapse' will override my override for the forum and go into collapsed view.

Once this is working then I will do a similar thing with dateslip.

Thanks.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Sponsored Links
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
if (stristr(",{$config['view_expanded']},",",$Board_q,") && empty($view)) {
$view = "expanded";
}

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Thanks - however that seesm to revert the display back to collapsed mode

As an example...

http://www.fansfocus.com/forum/postlist.php?Cat=0&Board=conference_south - will show to all in expanded view

http://www.fansfocus.com/forum/postlist.php/Cat/0/Board/Urchins2 is shown in collapsed view to all.

Great

They both also show the correct -collapse or +expand buttons, but only the one on http://www.fansfocus.com/forum/postlist.php/Cat/0/Board/Urchins2 will work.

Maybe it needs a bigger alteration - although even if we made the view part of w3t_Boards, it would still call it into postlist.php at a similar time, so probably still wouldn't work, as after all we are overriding even the choice made by the user, and maybe for this reason the button is also failing, as it ovrrides it each time.


Incidently I also changed

$postrow[$z]['Subject'] = "<img src="{$config['images']}/$specialicon" border="0"> <img src="{$config['images']}/$icon" border="0"> $Subject";

to

$postrow[$z]['Subject'] = "$Subject";

As I couldn't see the point in having extra icons on every row in expanded view before the subject - just seems to clutter the page (unless someone tell's me I mad )


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
OK....

In postlist.php

##### search for:
// If $view isn't set then it gets set to the default view

#### add below:
$views = $view;


Then use this expression to evaluate whether the view is set to expanded or not

if (stristr(",{$config['view_expanded']},",",$Board_q,") && empty($views)) {
$view = "expanded";
}

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Perfect - thank you.

Now to see if I can alter the dateslip to be changeable for both guests as well as members


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Sponsored 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
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,575
Posts293,931
Members13,824
Most Online6,139
Sep 21st, 2024
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,834
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
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-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)