Need custom work? Register your interest here.

Jump to content


Welcome to DevFuse Forums


Sign In  Log in with Facebook

Create Account
Welcome to DevFuse Forums, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of DevFuse Forums by signing in or creating an account.
  • Start new topics and reply to others
  • Subscribe to topics and forums to get email updates
  • Get your own profile page and make new friends
  • Send personal messages to other members.
 
Guest Message by DevFuse

Tutorial info Visit support topic

  • Added on: Dec 29 2010 04:12 AM
  • Views: 3464
 


Hiding links from guests.

This is a very shor tutorial which will teach you on how to hide both links and hidden codes in posts from unregistered users (guests)

Posted by ArpSofttt on Dec 29 2010 04:12 AM
You will have to edit one file:

/admin/applications/forums/modules_public/forums/topics.php

First, make a backup file so that if anything goes wrong, you can replace it...

After doing that, find this line of code:

$template = $this->registry->output->getTemplate('topic')->topicViewTemplate( $this->forum, $this->topic, $post_data, $displayData );

Above that line, add following code:

if (!$this->memberData['member_id'])
                {
                    foreach($post_data as $k => $postData)
                        {
                            foreach($postData as $key => $post)
                                {
                                    $post_data[$k][$key]['post'] = preg_replace('#<pre class=\'prettyprint\'>(.*?)</pre>#', ' <font color=\'red\'><b>Please <a href=\'index.php?app=core&module=global&section=login\' style=\'text-decoration:none;\'>Login</a> or <a href=\'index.php?app=core&module=global&section=register\' style=\'text-decoration:none;\'>Signup</a> to see this Hidden Code</b></font> ', $post['post']);
                                }
                        }
                }
                
        if (!$this->memberData['member_id'])
                {
                    foreach($post_data as $k => $postData)
                        {
                            foreach($postData as $key => $post)
                                {
                                        $post_data[$k][$key]['post'] = preg_replace('#<a(.*?)rel=\'nofollow external\'(.*?)<(.*?)a>#', ' <font color=\'red\'><b>Please <a href=\'index.php?app=core&module=global&section=login\' style=\'text-decoration:none;\'>Login</a> or <a href=\'index.php?app=core&module=global&section=register\' style=\'text-decoration:none;\'>Signup</a> to see this Hidden Link</b></font> ', $post['post']);
                                }
                        }
                }

Final result, all the guests will see this message instead of links:

Please Login or Signup to see this Hidden Link!

Please Login or Signup to see this Hidden Code!

Powered by Tutorials 1.5.1 © 2014, by Michael McCune