TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,229
  • Total Topics: 21,353
  • Online today: 976
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 122
  • Total: 122

Google bot and Spiders mod for SMF1.1rc3 - default theme

Started by dozzer, December 07, 2006, 10:11:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Blue Steel

OK I stand corrected :( .. (Egg on face and all that other embarrassing stuff)  just last time i did it it didn't take spiders out of guests.. :( sorry once again

(When hill I learn to keep my mouth shut  LOL )

Zetan

I've set my spiders to member view only.
What do I need to add to the TPortalBlocks.template.php
so that guests cant view the spiders in the stats block?
They shouldn't be able to view the buddies either... seeing as guests don't have Buddies  :uglystupid2:



  • Users: 0
  • Buddies: 0
  • Guests: 1
  • Spiders: 0
  • Total: 1

jdvarner

how you all getting it to work correctly with the spiders... when that mod hasnt been updated since rc3?

rebelrose

It works on my forum as well, not sure why but it does  ???

rebelrose

Quote from: Zetan on March 02, 2007, 03:19:37 PM
I've set my spiders to member view only.
What do I need to add to the TPortalBlocks.template.php
so that guests cant view the spiders in the stats block?
They shouldn't be able to view the buddies either... seeing as guests don't have Buddies  :uglystupid2:



  • Users: 0
  • Buddies: 0
  • Guests: 1
  • Spiders: 0
  • Total: 1

Do you have the Guest permissions set to view spiders?

siath

Quote from: jdvarner on March 03, 2007, 02:30:44 AM
how you all getting it to work correctly with the spiders... when that mod hasnt been updated since rc3?
Because, nothing has changed to throw the google bots and spiders off keel. I have it working too.

Siath

siath

Ok a couple of small adds to the blocks that will make it so if you don't have permission to view spiders you won't see them.

The follow code inludes the previous code as well just replace the whole TPortal_statsbox with this code:

// Modified By OnTapÂÃ,©
function TPortal_statsbox()
{
       global $context, $settings, $options, $scripturl, $txt, $db_prefix, $modSettings;

        echo '<div style="padding: 5px;" class="smalltext">';

      $bullet = '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
      $bullet2 = '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';


   $result = db_query("
      SELECT COUNT(ID_BOARD)
      FROM {$db_prefix}boards", __FILE__, __LINE__);
   list ($modSettings['boards']) = mysql_fetch_row($result);
   mysql_free_result($result);

   $result = db_query("
      SELECT COUNT(ID_CAT)
      FROM {$db_prefix}categories", __FILE__, __LINE__);
   list ($modSettings['categories']) = mysql_fetch_row($result);
   mysql_free_result($result);

       if(isset($context['TPortal']['userbox']['stats']))
      // members stats
            echo '
                 <img src="'.$settings['images_url'].'/icons/members.gif" style="margin: 0;" align="bottom" alt="" />
                 <a href="'.$scripturl.'?action=mlist"><b>'.$txt[19].'</b></a>
                 <br />'.$bullet.$txt[488].': ' , isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , '
                 <br />'.$bullet.$txt['tp-latest']. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><b>', $modSettings['latestRealName'], '</b></a>';


$today = strtotime("24 hours ago");
date('j') == 1 ? $thismonth = $today : $thismonth = strtotime(date('F') . ' 1');
date('l') == 'Sunday' ? $thisweek = $today : $thisweek = strtotime('last Sunday');
date('M') == 'January' ? $thisyear = $thismonth : $thisyear = strtotime('January 1');

$query = db_query("SELECT
COUNT(dateRegistered > $thisyear OR NULL) as year,
COUNT(dateRegistered > $thismonth OR NULL) as month,
COUNT(dateRegistered > $thisweek OR NULL) as week,
COUNT(dateRegistered > $today OR NULL) as today
FROM {$db_prefix}members
WHERE is_activated = 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($query);

settype($row['today'], "integer");
settype($row['week'], "integer");
settype($row['month'], "integer");

echo '<br /><img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />', 'New This Year: ', $modSettings['totalMembers'],'<br />';

echo '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />', 'New This Month: ', $row['month'],'<br />';

echo '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />', 'New This Week: ', $row['week'],'<br />';

echo '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />', 'New Today: ', $row['today'];

       if(isset($context['TPortal']['userbox']['stats_all']))
      // more stats
            echo '
                  <hr /><img src="'.$settings['images_url'].'/icons/info.gif" style="margin: 0;" align="bottom" alt="" />
                 <a href="'.$scripturl.'?action=stats"><b>'.$txt['tp-stats'].'</b></a>
                 <br />'.$bullet.$txt[489].': '.$modSettings['totalMessages']. '
                 <br />'.$bullet. $txt[490].': '.$modSettings['totalTopics']. '
                 <br />'.$bullet. $txt[658].': '.$modSettings['categories']. '
                 <br />'.$bullet. $txt[665].': '.$modSettings['boards']. '
                 <br />'.$bullet.$txt['tp-mostonline-today'].': '.$modSettings['mostOnlineToday'].'
                 <br />'.$bullet.$txt['tp-mostonline'].': '.$modSettings['mostOnline'].'<br />
                 ('.timeformat($modSettings['mostDate']).')
              ';


       if(isset($context['TPortal']['userbox']['online'])){
      // add online users
            echo '<hr /><img src="'.$settings['images_url'].'/icons/online.gif" style="margin: 0;" align="bottom" alt="" />
                 <a href="'.$scripturl.'?action=who"><b>'.$txt[158].'</b></a><br />';

            $online = ssi_whosOnline('array');
            echo $bullet.$txt['tp-users'].': '.$online['num_users'];
            echo '<br />'.$bullet.$txt['tp-hidden'].': '.$online['hidden'];
            echo '<br />'.$bullet.$txt['tp-buddies'].': '.$online['buddies'];

           // Allowed user to see spiders online?
              if (!allowedTo('googlebot_view'))
                  {
            echo '<br />'.$bullet.$txt['tp-guests'].': '.($online['guests'] + $online['num_spiders']);
                   } else {
            echo '<br />'.$bullet.$txt['tp-guests'].': '.$online['guests'];
            echo '<br />'.$bullet.$txt['tp-spiders'].': '.$online['num_spiders'];
                        }
            echo '<br />'.$bullet.$txt['tp-total'].': '.$online['total_users'].'<hr />
         <div style="width: 100%; ' , $online['num_users']>14 ? 'height: 23ex;overflow: auto;' : '' ,'">';

      foreach($online['users'] as $user){
      echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
      echo '<br />';
      }
      echo '</div>';
     }
   if (!empty($context['spiders']) && (!$modSettings['ob_googlebot_display_own_list']))
   {
     foreach($context['spiders'] as $spider) {
      echo $bullet2 , $spider;
      echo '<br />';
      }
   }

   if (!empty($context['spiders']) && ($modSettings['ob_googlebot_display_own_list']))
   {
         echo '<br /><b>'.'Bots Online'.'</b><br /><hr />';
         echo '<div style="width: 100%; ' , $context['spiders']>10 ? 'height: 10ex;overflow: auto;' : '' ,'">';
     foreach($context['spiders'] as $spider) {
      echo $bullet2 , $spider;
      echo '<br />';
      }
         echo '</div>';
   }
  echo '</div>';
}


This code also includes gthe Catagories and Topics add on. If you don't want this just remove the two lines for it.

Should work just fine does on my board and the others I take care of.

Siath

Zetan

Thanks guys  :D

Can somebody remind me where the English language file is?
I can't find it anywhere  ???

ZTN

siath

themes/(theme)/languages? off top of my head althought I have been up for 38 hours :P

Siath

Zetan

Thanks... I'm sure I've looked in there.
* Zetan looks for the 3rd time... Must be going blind.

This website is proudly hosted on Crocweb Cloud Website Hosting.