Previous Thread
Next Thread
Print Thread
Hop To
Joined: Mar 2008
Posts: 327
D
Enthusiast
Enthusiast
D Offline
Joined: Mar 2008
Posts: 327
Okay, this should do the trick according to what your wishes were. You can totally forget worrying about setting Guest permissions for anything. You can revert all Guest permissions back to stock, and this modification alone will do the trick. Give it a shot and let me know if I got it right.

Open up your copy of ubbthreads.php in the root folder.

find:
PHP Code
	 // Does user have to be logged in?
		if (!isset($user['USER_ID']) || !$user['USER_ID']) {
			if (array_get($init, 'regonly', 0) == 1) {
				$fatal_error = true;
				$fatal_error_msg = "FATAL_NOT_LOGGED";
			} // end if
		} // end if 
replace with:
PHP Code
	 // Does user have to be logged in?
		if (!isset($user['USER_ID']) || !$user['USER_ID']) {
			if (($ubb != "newuser") && ($ubb != "faq") && ($ubb != "boardrules") && ($ubb != "login") && ($ubb != "logout") && ($ubb != "start_page") && ($ubb != "adduser")) {
				$fatal_error = true;
				$fatal_error_msg = "FATAL_NOT_LOGGED";
			} // end if
		} // end if 

find:
PHP Code
 if (isset($left_column_data['template'])) {
		smartyDisplay($left_column_data);
	} // end if
	if (isset($smarty_display['body'])) {
		// Need to set graemlin url based on the user's style
		$smarty->register_outputfilter("graemlin_url");
		smartyDisplay($smarty_display['body']);
	} // end if
	if (isset($right_column_data['template'])) {
		smartyDisplay($right_column_data);
	} // end if 
replace with:
PHP Code
 if ((isset($user['USER_ID'])) && ($user['USER_ID'])) {
		if (isset($left_column_data['template'])) {
			smartyDisplay($left_column_data);
		} // end if
	} // end if
	if (isset($smarty_display['body'])) {
		// Need to set graemlin url based on the user's style
		$smarty->register_outputfilter("graemlin_url");
		smartyDisplay($smarty_display['body']);
	} // end if
	if ((isset($user['USER_ID'])) && ($user['USER_ID'])) {
		if (isset($right_column_data['template'])) {
			smartyDisplay($right_column_data);
		} // end if
	} // end if 

Enjoy.

Last edited by Gizmo; 03/01/2009 12:13 AM.
Joined: Jun 2006
Posts: 33
D
newbie
newbie
D Offline
Joined: Jun 2006
Posts: 33
Appears to work perfectly! Mucho thanks.

Joined: Mar 2008
Posts: 327
D
Enthusiast
Enthusiast
D Offline
Joined: Mar 2008
Posts: 327
Glad I could be of assistance. smile

Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
A hack is fine if people are willing to do so on each version change.
But the reason for my post in this forum was a suggestion to get this migrated into a permanent CP option.

Last edited by Ruben; 02/25/2009 3:09 PM.

Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Mar 2008
Posts: 327
D
Enthusiast
Enthusiast
D Offline
Joined: Mar 2008
Posts: 327
Baby steps man, it takes more coding to integrate these things into the CP. I wanted to get this out to him as quickly as I could so he could begin implementing it. Once finals are over this week, I'll have more time to tinker with things. smile

Plus, you don't usually have to re-implement on version changes. I just pull up my copy of BeyondCompare and copy over the changed stock code, leaving my modifications alone.

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
i still advocate for modifying the stock ubbthreads.php and add some pre and post hooks in, so we don't need to modify ANY stock code at all!

we do the _run and _gpc now, but there should be a way to add in mods to the ubbt-engine...

that would allow easily added features in a ../add-ons directory and not interfere in upgrades..

right now, upgrades cause pain for this reason.. Beyond Compare makes it easier, but it's really something that isn't NECESSARY given a more flexible "ubb=xxx" engine wink

Joined: Jun 2006
Posts: 33
D
newbie
newbie
D Offline
Joined: Jun 2006
Posts: 33
Unfortunately this hack apparently broke captcha, see https://www.ubbcentral.com/forums/ubbthreads.php/topics/223119.html

Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
So back to my original post.
Add this to the list.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Mar 2008
Posts: 327
D
Enthusiast
Enthusiast
D Offline
Joined: Mar 2008
Posts: 327
Sorry about that. I do my testing on my laptop, and don't have ImageMagick or GD2 installed. I never use captcha on my Website, so I never thought to install either of those locally. Anywho, I made some changes that should fix it. Here are the entire instructions with the changes implemented.

Open up your copy of ubbthreads.php in the root folder.

find:
PHP Code
	 // Does user have to be logged in?
		if (!isset($user['USER_ID']) || !$user['USER_ID']) {
			if (array_get($init, 'regonly', 0) == 1) {
				$fatal_error = true;
				$fatal_error_msg = "FATAL_NOT_LOGGED";
			} // end if
		} // end if 
replace with:
PHP Code
	 // Does user have to be logged in?
		if (!isset($user['USER_ID']) || !$user['USER_ID']) {
			if (($ubb != "newuser") && ($ubb != "faq") && ($ubb != "boardrules") && ($ubb != "login") && ($ubb != "logout") && ($ubb != "start_page") && ($ubb != "adduser") && ($ubb != "captcha")) {
				$fatal_error = true;
				$fatal_error_msg = "FATAL_NOT_LOGGED";
			} // end if
		} // end if 

find:
PHP Code
 if (isset($left_column_data['template'])) {
		smartyDisplay($left_column_data);
	} // end if
	if (isset($smarty_display['body'])) {
		// Need to set graemlin url based on the user's style
		$smarty->register_outputfilter("graemlin_url");
		smartyDisplay($smarty_display['body']);
	} // end if
	if (isset($right_column_data['template'])) {
		smartyDisplay($right_column_data);
	} // end if 
replace with:
PHP Code
 if ((isset($user['USER_ID'])) && ($user['USER_ID'])) {
		if (isset($left_column_data['template'])) {
			smartyDisplay($left_column_data);
		} // end if
	} // end if
	if (isset($smarty_display['body'])) {
		// Need to set graemlin url based on the user's style
		$smarty->register_outputfilter("graemlin_url");
		smartyDisplay($smarty_display['body']);
	} // end if
	if ((isset($user['USER_ID'])) && ($user['USER_ID'])) {
		if (isset($right_column_data['template'])) {
			smartyDisplay($right_column_data);
		} // end if
	} // end if 

Joined: Mar 2008
Posts: 327
D
Enthusiast
Enthusiast
D Offline
Joined: Mar 2008
Posts: 327
Tested and verified that Captcha works with this method.

Joined: Jun 2006
Posts: 33
D
newbie
newbie
D Offline
Joined: Jun 2006
Posts: 33
DLWebmaestro:

I opened things up this evening on my board and immediately ran into one more snag with this hack; I think it is probably the last one. I have e-mail verification turned on, and when the new member clicks on the verification link they get a fatal error. I'm back to using the stock code.

I think I know what I would need to add, but I would rather not guess, and the full code in this thread should be fixed anyway.

Thanks again for your work on this one!

Joined: Mar 2008
Posts: 327
D
Enthusiast
Enthusiast
D Offline
Joined: Mar 2008
Posts: 327
Replace:
PHP Code
if (($ubb != "newuser") && ($ubb != "faq") && ($ubb != "boardrules") && ($ubb != "login") && ($ubb != "logout") && ($ubb != "start_page") && ($ubb != "adduser") && ($ubb != "captcha")) { 
with:
PHP Code
if (($ubb != "newuser") && ($ubb != "faq") && ($ubb != "boardrules") && ($ubb != "login") && ($ubb != "logout") && ($ubb != "start_page") && ($ubb != "adduser") && ($ubb != "captcha") && ($ubb != "verifyemail")) { 

Learning as we go! wink

I would fix the full code, but the edit time has long passed.

I'm working on getting this fully CPed down to all the nitty gritties.

Joined: Jun 2006
Posts: 33
D
newbie
newbie
D Offline
Joined: Jun 2006
Posts: 33
That was quick! I will implement/test it tomorrow.

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Originally Posted by Sirdude
i still advocate for modifying the stock ubbthreads.php and add some pre and post hooks in, so we don't need to modify ANY stock code at all!

we do the _run and _gpc now, but there should be a way to add in mods to the ubbt-engine...

I'll definitely be working on getting a hook system in for 8.0. I still have to figure out the nitty gritties, and then we'll need to figure out where all the hooks need to be, documented, etc.

Joined: Dec 2003
Posts: 1,796
Pooh-Bah
Pooh-Bah
Joined: Dec 2003
Posts: 1,796
Sweet! thumbsup


- Allen
- ThreadsDev | PraiseCafe
Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
Do we need to send some hand rolled cubans to Rick to speed up the process?


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
i'll donate a box, if he puts it in 7.5.2 wink

Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
A BOX!!!!
I was thinking just a couple.
Wow I didn't know it was that important.

Heh Heh Heh.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Mar 2008
Posts: 327
D
Enthusiast
Enthusiast
D Offline
Joined: Mar 2008
Posts: 327
Rick can just go up to Canada to get some Cuban cigars any time he wants. Victoria is so beautiful.

Joined: Dec 2003
Posts: 1,796
Pooh-Bah
Pooh-Bah
Joined: Dec 2003
Posts: 1,796
Yes, I went there the one time I was in Seattle, the boat ride there was beautiful too - we must have seen 30-40 whales.


- Allen
- ThreadsDev | PraiseCafe
Joined: Dec 2003
Posts: 6,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
There be whales here. Quoted by Scotty from Star Trek.

One of these days I will make it out there. I would love to see those huge mammals.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 16,365
Likes: 126
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,365
Likes: 126
I split this unsupported modification from the feature request that it was originally tacked on to; the original thread can be found here

Last edited by Gizmo; 03/01/2009 12:23 AM.

I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Mar 2008
Posts: 327
D
Enthusiast
Enthusiast
D Offline
Joined: Mar 2008
Posts: 327
Clickity click for a fully-CPed version with more options/flexibility.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Post Counts zeroed out
by Baldeagle - 11/03/2024 3:05 PM
Upgraded to ver8 - now can't login
by phoenix011235 - 10/24/2024 7:50 AM
Very weird error this morning.
by Baldeagle - 10/23/2024 4:35 PM
Help error and stop forum spam
by ehill - 10/23/2024 11:13 AM
Very slow web server response times
by Baldeagle - 10/18/2024 3:22 PM
Who's Online Now
1 members (Ruben), 179 guests, and 54 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)