removing the function from viewforum..

Problems with forum installation, administration, moderation and other phpBB related support.

Moderator: Moderators

removing the function from viewforum..

Postby Stryker on Sat Apr 07, 2007 1:26 pm

Hello, i want to ask you people..
does anyone know what function i need to remove if i want to completly delete the function that is counting how many times has the topic been viewed(on viewforum)?
User avatar
Stryker
Registered User
Registered User
 
Posts: 1318
Joined: Mon Aug 29, 2005 7:54 am
Location: ------------

Postby Disturbed One on Sat Apr 07, 2007 2:48 pm

Are you looking to stop phpBB from keeping track of the views, or do you just want to prevent it from showing up on the viewforum page?

If it is the second of those two, the solution can be a simple edit of viewforum_body.tpl

Please provide a link to that file if you do not know how to do this yourself.
High Velocity Media - Accelerated Internet Solutions
http://hvmdesign.com | contact[at]hvmdesign[dot]com
User avatar
Disturbed One
Moderator
Moderator
 
Posts: 2106
Joined: Sat Oct 09, 2004 8:12 pm
Location: Right behind you...

Postby Stryker on Sat Apr 07, 2007 3:28 pm

i have removed it from style but i want to completly remove this function...
User avatar
Stryker
Registered User
Registered User
 
Posts: 1318
Joined: Mon Aug 29, 2005 7:54 am
Location: ------------

Postby Stryker on Tue Apr 10, 2007 6:22 am

bump please?
User avatar
Stryker
Registered User
Registered User
 
Posts: 1318
Joined: Mon Aug 29, 2005 7:54 am
Location: ------------

Postby Stryker on Tue Apr 10, 2007 7:49 am

will it be OK if i delete only this from viewtopic.php?
Code: Select all
//
// Update the topic view counter
//
$sql = "UPDATE " . TOPICS_TABLE . "
   SET topic_views = topic_views + 1
   WHERE topic_id = $topic_id";
if ( !$db->sql_query($sql) )
{
   message_die(GENERAL_ERROR, "Could not update topic views.", '', __LINE__, __FILE__, $sql);
}
User avatar
Stryker
Registered User
Registered User
 
Posts: 1318
Joined: Mon Aug 29, 2005 7:54 am
Location: ------------

Postby DooBDee on Tue Apr 10, 2007 9:47 am

Yes, that should work fine.
DooBDee
Website Ninja
DooBDee.net
User avatar
DooBDee
Moderator
Moderator
 
Posts: 3530
Joined: Tue Mar 01, 2005 6:28 pm
Location: DooBDee.net

Postby Stryker on Tue Apr 10, 2007 2:33 pm

so now i can delete the topic_views from db, right?
User avatar
Stryker
Registered User
Registered User
 
Posts: 1318
Joined: Mon Aug 29, 2005 7:54 am
Location: ------------

Postby Stryker on Tue Apr 10, 2007 3:05 pm

Oh and i have sql cache mod from you and i found this in viewforum.php:
Code: Select all
if($cached1 || $cached2)
{
   $update_list = array();
   for($i=0; $i<count($topic_rowset); $i++)
   {
      $update_list[] = $topic_rowset[$i]['topic_id'];
   }
   if(count($update_list))
   {
      $sql = "SELECT topic_id, topic_views FROM " . TOPICS_TABLE . " WHERE topic_id IN (" . implode(', ', $update_list) . ")";
      $list = array();
      $result = $db->sql_query($sql);
      while( $row = $db->sql_fetchrow($result) )
      {
         $list[$row['topic_id']] = $row['topic_views'];
      }
      $db->sql_freeresult($result);
      for($i=0; $i<count($topic_rowset); $i++)
      {
         if(isset($list[$topic_rowset[$i]['topic_id']]))
         {
            $topic_rowset[$i]['topic_views'] = $list[$topic_rowset[$i]['topic_id']];
         }
      }
      unset($list);
   }
}

i dont know how to delete topic_views from there, because i am not sure if i dont break something :( can you help me?
User avatar
Stryker
Registered User
Registered User
 
Posts: 1318
Joined: Mon Aug 29, 2005 7:54 am
Location: ------------

Postby Stryker on Wed Apr 11, 2007 2:57 pm

bump? :) i could delete the whole code i posted here, huh? it is all about topic_views caching.. so if i dont use it, i could delete this thing... OK?
User avatar
Stryker
Registered User
Registered User
 
Posts: 1318
Joined: Mon Aug 29, 2005 7:54 am
Location: ------------

Postby Stryker on Thu Apr 12, 2007 7:15 am

bump please?
i have added this from SQL CACHE so i dont know what to delete if i want to remove only topic_views caching...
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
viewforum.php

#
#-----[ FIND ]------------------------------------------
#
      WHERE forum_id = $forum_id";
   if ( !($result = $db->sql_query($sql)) )

#
#-----[ REPLACE WITH ]------------------------------------------
#
      WHERE forum_id = $forum_id";
   if ( !($result = $db->sql_query($sql, false, true)) )

#
#-----[ FIND ]------------------------------------------
#
         WHERE forum_id = $forum_id";
      if ( !($result = $db->sql_query($sql)) )

#
#-----[ REPLACE WITH ]------------------------------------------
#
         WHERE forum_id = $forum_id";
      if ( !($result = $db->sql_query($sql, false, 'posts_')) )

#
#-----[ FIND ]------------------------------------------
#
   GROUP BY u.user_id, u.username 
   ORDER BY u.user_id";
if ( !($result = $db->sql_query($sql)) )

#
#-----[ REPLACE WITH ]------------------------------------------
#
   GROUP BY u.user_id, u.username 
   ORDER BY u.user_id";
if ( !($result = $db->sql_query($sql, false, true)) )

#
#-----[ FIND ]------------------------------------------
#
   GROUP BY g.group_id, g.group_name 
   ORDER BY g.group_id";
if ( !($result = $db->sql_query($sql)) )

#
#-----[ REPLACE WITH ]------------------------------------------
#
   GROUP BY g.group_id, g.group_name 
   ORDER BY g.group_id";
if ( !($result = $db->sql_query($sql, false, true)) )

#
#-----[ FIND ]------------------------------------------
#
         AND p.post_time >= $min_topic_time";

   if ( !($result = $db->sql_query($sql)) )

#
#-----[ REPLACE WITH ]------------------------------------------
#
         AND p.post_time >= $min_topic_time";

   if ( !($result = $db->sql_query($sql, false, 'posts_')) )

#
#-----[ FIND ]------------------------------------------
#
   ORDER BY t.topic_last_post_id DESC ";
if ( !($result = $db->sql_query($sql)) )

#
#-----[ REPLACE WITH ]------------------------------------------
#
   ORDER BY t.topic_last_post_id DESC ";
if ( !($result = $db->sql_query($sql, false, 'posts_')) )

#
#-----[ FIND ]------------------------------------------
#
$topic_rowset = array();

#
#-----[ BEFORE, ADD ]------------------------------------------
#
$cached1 = $db->cached;

#
#-----[ FIND ]------------------------------------------
#
   LIMIT $start, ".$board_config['topics_per_page'];
if ( !($result = $db->sql_query($sql)) )

#
#-----[ REPLACE WITH ]------------------------------------------
#
   LIMIT $start, ".$board_config['topics_per_page'];
if ( !($result = $db->sql_query($sql, false, 'posts_')) )

#
#-----[ FIND ]------------------------------------------
#
$total_topics = 0;

#
#-----[ BEFORE, ADD ]------------------------------------------
#
$cached2 = $db->cached;

#
#-----[ FIND ]------------------------------------------
#
//
// Total topics ...
//

#
#-----[ BEFORE, ADD ]------------------------------------------
#

if($cached1 || $cached2)
{
   $update_list = array();
   for($i=0; $i<count($topic_rowset); $i++)
   {
      $update_list[] = $topic_rowset[$i]['topic_id'];
   }
   if(count($update_list))
   {
      $sql = "SELECT topic_id, topic_views FROM " . TOPICS_TABLE . " WHERE topic_id IN (" . implode(', ', $update_list) . ")";
      $list = array();
      $result = $db->sql_query($sql);
      while( $row = $db->sql_fetchrow($result) )
      {
         $list[$row['topic_id']] = $row['topic_views'];
      }
      $db->sql_freeresult($result);
      for($i=0; $i<count($topic_rowset); $i++)
      {
         if(isset($list[$topic_rowset[$i]['topic_id']]))
         {
            $topic_rowset[$i]['topic_views'] = $list[$topic_rowset[$i]['topic_id']];
         }
      }
      unset($list);
   }
}
User avatar
Stryker
Registered User
Registered User
 
Posts: 1318
Joined: Mon Aug 29, 2005 7:54 am
Location: ------------

Postby kvfb97 on Thu Apr 12, 2007 11:43 am

Greetings,

Do a search in that file for 'topic_views', then delete pieces of code you think you don't need using trial and error.
Tip: Don't argue with idiots, they'll drag you down to their level and beat you with experience.
User avatar
kvfb97
Registered User
Registered User
 
Posts: 1774
Joined: Mon Aug 02, 2004 8:18 am
Location: Northern Ireland, UK

Postby Stryker on Thu Apr 12, 2007 1:36 pm

well i have delete this whole code viewtopic.php?p=88892#88892 and i have no errors, but how cAn i know if everything is OK? that is why i am askin gfor help :)
User avatar
Stryker
Registered User
Registered User
 
Posts: 1318
Joined: Mon Aug 29, 2005 7:54 am
Location: ------------

Postby kvfb97 on Thu Apr 12, 2007 1:40 pm

Well if there are no errors, then everything should be fine... ;)
Tip: Don't argue with idiots, they'll drag you down to their level and beat you with experience.
User avatar
kvfb97
Registered User
Registered User
 
Posts: 1774
Joined: Mon Aug 02, 2004 8:18 am
Location: Northern Ireland, UK

Postby Stryker on Thu Apr 12, 2007 1:59 pm

and what about this that is added from SQL CACHE and used in the previous code?
Code: Select all

#-----[ FIND ]------------------------------------------ 

$total_topics = 0; 


#-----[ BEFORE, ADD ]------------------------------------------ 

$cached2 = $db->cached;


and

Code: Select all

#-----[ FIND ]------------------------------------------ 

$topic_rowset = array(); 


#-----[ BEFORE, ADD ]------------------------------------------ 

$cached1 = $db->cached;
User avatar
Stryker
Registered User
Registered User
 
Posts: 1318
Joined: Mon Aug 29, 2005 7:54 am
Location: ------------

Postby Stryker on Fri Apr 13, 2007 11:56 am

really any idea what to do? i dont want to break any other files that are caching data from viewforum.php, if there is only caching of topic views added from SQL CACHE, it should be OK to delete it, but i dont know... :(
User avatar
Stryker
Registered User
Registered User
 
Posts: 1318
Joined: Mon Aug 29, 2005 7:54 am
Location: ------------

Next

Return to phpBB Support

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron