phpBBHacks.com - php null command?
phpBBHacks.com, the place for phpBB users
StatsForums Home   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in
FAQFAQ   SearchSearch   MemberlistMemberlist   TutorialsTutorials   ContactContact Us
Add Us:     MySpace     Facebook     StumbleUpon
Username:    Password:
Remember Me?    
php null command?
BlinkList
del.icio.us
Furl
linkaGoGo
reddit
Simpy
Mister Wong
Yahoo! My Web

Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Hack Development
 See a User Guidelines violation? Please contact us.
Author Message

Coyote
Experienced User

Joined: 08 Dec 2006
Posts: 338

PostPosted: February 4th 2008, 11:08 am    Post subject: php null command? Reply with quote

I found a conflict with the "Mod own topics" mod and the "Featured Topics" mod. It seems that any member in a forum that allows "mod own topics" can remove a topic from the featured topics list. I'm just barely beginning to understand PHP, so I thought I might be able to solve this one on my own.

So I went into posting.php and found this block of code:

Code:
//
// featured toggle selection
//
if (($userdata['user_level'] == ADMIN) && ($post_info['featured'] == 0))
{
   
   $template->assign_block_vars('switch_featured_checkbox', array());
}
else
{
$template->assign_block_vars('switch_featuredR_checkbox', array());
}


And replaced it with this:

Code:
if (($userdata['user_level'] == ADMIN) && ($post_info['featured'] == 0))
{
   
   $template->assign_block_vars('switch_featured_checkbox', array());
}
elseif (($userdata['user_level'] == ADMIN) && ($post_info['featured'] == 1))
{
$template->assign_block_vars('switch_featuredR_checkbox', array());
}
else $null = $null; 


It works just fine, but there has got to be a more elegant way to do it. I'm pretty sure that there's another way to not display the "remove from featured topics" checkbox without using $null = $null...

Thanks ahead of time.
_________________
Free Code Editor | phpBB2 as CMS | My Hacks
Back to top
View user's profile Send private message Visit poster's website

Thoul
VIP

Joined: 30 Jul 2002
Posts: 17676
Location: USA

PostPosted: February 22nd 2008, 8:31 pm    Post subject: Reply with quote

Just leave out the else $null = $null; line. You're not required to have an else clause if you don't need it.
_________________
Phantasy Star: The Fringes of Algo

Install, remove, or upgrade SQL with Advanced DB Update Generator! Now with phpBB 3 Support!

My phpBB Books, Hacks, and Other Works «·» 70+ Listings @ phpBBHacks.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Hack Development All times are GMT - 6 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Big Message Boards - Free JavaScript - phpBB2 - phpbb styles - Suporte phpBB - phpBB.it - phpBB Česky - phpBB Turkiye - phpBBArabia.com - phpBB-fr.com - Romanian phpBB online community - phpBB-TW.net - phpBBservice.nl - phpBB Brasil

Network: iFroggy Network Blog - iFroggy Hosting - SportsForums.net - KarateForums.com - YanksBlog.com - PhotoshopForums.com - DeveloperCube - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - DrGregHouse.com - Bad Boy Blog - BadBoyForums.com - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact Us - Staff - User Guidelines >

Copyright © 2001-2008. iFroggy Network, phpBBHacks.com. All Rights Reserved. Privacy Policy. We Support phpBBHacks.com (of course!).
Powered by phpBB © phpBB Group. phpBB SEO. Hosted by 100MegsWebHosting. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.