aliks0905
Dec 3rd 2007, 1:28 pm
Hi, I have modified my code for my modded phpbb forum, and I just have a quick question and if its a possible one.
My hide 'hack' currently is set to hide the hidden content (using [hide] tags) from everybody except: admins/mods, and those with over 50 posts. Is it possible to also add to that exceptions list that if someone is referred from a certain site (google.com) then they can see the hidden content as well?
Here is my code:
1. if($item['iteration'] > 1)
2. {
3. return $error;
4. }
5. global $db, $topic_id, $userdata, $mode;
6. $show = false;
7. if($userdata['session_logged_in'])
8. {
9. $sql = "SELECT p.poster_id, p.topic_id
10. FROM " . POSTS_TABLE . " p
11. WHERE p.topic_id = $topic_id
12. AND p.poster_id = " . $userdata['user_id'];
13. $resultat = $db->sql_query($sql);
14. $show = $db->sql_numrows($resultat) ? true : false;
15. if ( ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD) || ($userdata['user_posts'] > 50))
16. {
17. $show = true;
18. }
My hide 'hack' currently is set to hide the hidden content (using [hide] tags) from everybody except: admins/mods, and those with over 50 posts. Is it possible to also add to that exceptions list that if someone is referred from a certain site (google.com) then they can see the hidden content as well?
Here is my code:
1. if($item['iteration'] > 1)
2. {
3. return $error;
4. }
5. global $db, $topic_id, $userdata, $mode;
6. $show = false;
7. if($userdata['session_logged_in'])
8. {
9. $sql = "SELECT p.poster_id, p.topic_id
10. FROM " . POSTS_TABLE . " p
11. WHERE p.topic_id = $topic_id
12. AND p.poster_id = " . $userdata['user_id'];
13. $resultat = $db->sql_query($sql);
14. $show = $db->sql_numrows($resultat) ? true : false;
15. if ( ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD) || ($userdata['user_posts'] > 50))
16. {
17. $show = true;
18. }