Page 1 of 3

[ABD] Top Topics 1.3

Posted: Tue Jul 14, 2009 10:46 am
by Kamahl19
MOD Title: Top Topics
MOD Descripiont: This MOD displays on index page latest 5 newest topics, newest posts, most readed and most viewed topics.
MOD Version: 1.3

Works with: phpbb3.0.5 (prosilver, subSilver2)
Language: English, Czech

Author: phpbb3hacks.com (Culprit)

License: GNU General Public License v2

Database update: Database update file top_topics_mod_install.php requires UMIL (Unified MOD Install Library)
MOD Format: MODX

MOD Download: http://www.phpbb3hacks.com/viewforum.php?f=39

Re: Top Topics 1.3

Posted: Tue Jul 14, 2009 11:00 am
by silneil
Hello Kamahl,

Thanks for this MOd.

You have a Demo?

Re: [RC] Top Topics 1.3

Posted: Thu Jul 16, 2009 10:27 am
by -tribe-
ok ive tryed this and i can say don't bother until there is a better release

ok first off it requires you to have umil (complete pain in arse, just give us the god damn sql statements we can install the database ourself) umil didnt work and give me errors straight away yes i have the latest one

ok after a few attempts finally got though, but with errors

so now i visit my site and i get

Code: Select all

SQL ERROR [ mysql4 ]

Table 'spiderdata.phpbb_top_topics_order' doesn't exist [1146]

SQL

INSERT INTO phpbb_top_topics_order (tt_order, tt_title, tt_sql, tt_display, tt_additional, tt_goto) VALUES (1, 'TOP_TOPIC_TOPICS', 'sql_topics', 1, '', 0)

BACKTRACE

FILE: includes/db/mysql.php
LINE: 174
CALL: dbal->sql_error()

FILE: top_topics_mod_install.php
LINE: 120
CALL: dbal_mysql->sql_query()
missing tables so the umil clearly never worked, so i visit the authors site and there is another member with the same problem but author denies the problem (there must be something there i have the same problem)

use the supplied sql statement which should have been supplied at the beginning (please note change database name in the statement before running)

anyway i have it running now and i have 2 of each column displaying

also theres no acp install instructions, when i finally get it running theres no way to remove the duplicate column either in the acp

i would say clear of this one for now and put it back into beta testin(if its ever been there), however i do feel that when the author decides to sort out the umil or get rid of it all together, and a few other fixes it will be a superb mod

Re: [RC] Top Topics 1.3

Posted: Mon Jul 20, 2009 10:02 pm
by wojtula
graet mod !! Image

thx Image

Re: [RC] Top Topics 1.3

Posted: Fri Jul 24, 2009 9:24 am
by vBB
How to add function to cut longer topics names?

For example: when I called topic "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" at the tables it looks like this:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxx
I would like, it would be like this:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
Someone could help?

Re: [RC] Top Topics 1.3

Posted: Fri Jul 24, 2009 2:39 pm
by usenet2you
http://phpbb3hacks.com/viewtopic.php?p=455#p455

Look that post(s)

I've asked it a while ago and got that answers.

Re: [RC] Top Topics 1.3

Posted: Fri Jul 24, 2009 8:51 pm
by vBB
Thanks! I will see whether it will be working ;)

Re: [RC] Top Topics 1.3

Posted: Sat Jul 25, 2009 8:16 am
by vBB
This is my functions_top_topics.php file:

Code: Select all

<?php

if ( !defined( 'IN_PHPBB'))
{
	exit;
}

    function cuttext($value, $length)
    {   
        if(is_array($value)) list($string, $match_to) = $value;
        else { $string = $value; $match_to = $value{0}; }

        $match_start = stristr($string, $match_to);
        $match_compute = strlen($string) - strlen($match_start);

        if (strlen($string) > $length)
        {
            if ($match_compute < ($length - strlen($match_to)))
            {
                $pre_string = substr($string, 0, $length);
                $pos_end = strrpos($pre_string, " ");
                if($pos_end === false) $string = $pre_string."...";
                else $string = substr($pre_string, 0, $pos_end)."...";
            }
            else if ($match_compute > (strlen($string) - ($length - strlen($match_to))))
            {
                $pre_string = substr($string, (strlen($string) - ($length - strlen($match_to))));
                $pos_start = strpos($pre_string, " ");
                $string = "...".substr($pre_string, $pos_start);
                if($pos_start === false) $string = "...".$pre_string;
                else $string = "...".substr($pre_string, $pos_start);
            }
            else
            {       
                $pre_string = substr($string, ($match_compute - round(($length / 3))), $length);
                $pos_start = strpos($pre_string, " "); $pos_end = strrpos($pre_string, " ");
                $string = "...".substr($pre_string, $pos_start, $pos_end)."...";
                if($pos_start === false && $pos_end === false) $string = "...".$pre_string."...";
                else $string = "...".substr($pre_string, $pos_start, $pos_end)."...";
            }

            $match_start = stristr($string, $match_to);
            $match_compute = strlen($string) - strlen($match_start);
        }
       
        return $string;
    }

$forum_id_field = '{initial_field}';
$sql_main = "SELECT  t.*, MAX(p.post_id) AS last_post
					FROM " . POSTS_TABLE . " AS p, " . TOPICS_TABLE . " AS t
					WHERE {available_forums_in_set}
						AND p.topic_id = t.topic_id AND p.forum_id = t.forum_id
					GROUP BY p.topic_id";
$sql_tt_avails = array(
	'sql_topics'	=> array(
		'sql'	=>	"{$sql_main}
					ORDER BY t.topic_time DESC",
		'field'	=>	't.forum_id',
		),
	'sql_replies'	=> array(
		'sql'	=>	"{$sql_main}
					ORDER BY t.topic_replies DESC, t.topic_time DESC",
		'field'	=>	't.forum_id',
		),
	'sql_views'		=> array(
		'sql'	=>	"{$sql_main}
					ORDER BY t.topic_views DESC, t.topic_time DESC",
		'field'	=>	't.forum_id',
		),
	'sql_posts'		=> array(
		'sql'	=>	"{$sql_main}
					ORDER BY p.post_time DESC",
		'field'	=>	't.forum_id',
		),
);

$goto_ary = array(
	0 => 'first',
	1 => 'unread',
	2 => 'last' 
);

if ( defined( 'IN_ADMIN'))
{
	return;
}


$top_topics_count = (int) $config['tt_count'];
$tt_logged = (( isset( $config['tt_logged']) && $config['tt_logged'] == 1 && $user->data['is_registered'] == 1)||$config['tt_logged']==0) ? true: false;

$visible_users_forums = $auth->acl_getf( 'f_read');
$available_forums_in_set = $db->sql_in_set( $forum_id_field, array_keys( $visible_users_forums), false, true);

$user->add_lang( 'mods/top_topics');

$rowset_order = array();
if ( $cache->_exists( '_top_topics'))
{
	$rowset_order = $cache->get( '_top_topics');
}

if ( count( $rowset_order) == 0 )
{
	$sql = "SELECT * FROM " . TT_ORDER_TABLE . " WHERE tt_display = 1 ORDER BY tt_order ASC"; 
	$rs_order = $db->sql_query( $sql);
	$rowset_order = $db->sql_fetchrowset( $rs_order);
	$db->sql_freeresult( $rs_order);
	$cache->put( '_top_topics', $rowset_order);
}

$rowset_order_count = count( $rowset_order);
$style_width = ceil( 100/$rowset_order_count) . '%';

$template->assign_vars( array(
		'TT_ALIGMENT'		=> ( isset( $config['tt_aligment']))? $config['tt_aligment'] : 'top',
		'S_TT_LOGGED_USERS' => $tt_logged,
		'TT_WIDTH'			=> ( isset($config['tt_width']) && $config['tt_width'] != '' ) ? $config['tt_width'] . "px" : '',

		'STYLE_WIDTH'	=> $style_width,
		'STYLE_WIDTH_LAST'	=> (99 - ( ($rowset_order_count -1) * $style_width )) . '%',
		));
$max_rows = 0;
for( $i_order = 0; $i_order < $rowset_order_count; $i_order++)
{
	$row_order = $rowset_order[$i_order];
	$sql = str_replace( '{available_forums_in_set}', $available_forums_in_set, $sql_tt_avails[$row_order['tt_sql']]['sql']);
	$sql = str_replace( $forum_id_field, $sql_tt_avails[$row_order['tt_sql']]['field'], $sql);
	//print $sql . ' <br />';
	$rs = $db->sql_query_limit( $sql, $top_topics_count);
	$rowset_order[$i_order]['rowset'] = $db->sql_fetchrowset( $rs);
	$rowset_order[$i_order]['count'] = count( $rowset_order[$i_order]['rowset']);

	$max_rows = ( $max_rows < $rowset_order[$i_order]['count'])? $rowset_order[$i_order]['count'] : $max_rows;
	
}
for( $i_order = 0; $i_order < $rowset_order_count; $i_order++)
{
	$title = isset( $user->lang[$rowset_order[$i_order]['tt_title']]) ? $user->lang[$rowset_order[$i_order]['tt_title']]: "{ " . $rowset_order[$i_order]['tt_title'] . " }";
	$tt_additional = $rowset_order[$i_order]['tt_additional'];
	$counter =0;

	$template->assign_block_vars( 'category', array(
		'S_FIRST'	=> ( $i_order == 0 ) ? true: false,
		'S_LAST'	=> ( $i_order == $rowset_order_count -1 ) ? true: false,

		'L_TITLE' => $title,
		));
	
	switch( $rowset_order[$i_order]['tt_goto'])
	{
		case 0:
			$add_link = '';
			break;
		case 1:
			$add_link = '&view=unread#unread';
			break;
		case 2:
			$add_link = '&p={last_post}#p{last_post}';
			break;
	}
	
	for( $i = 0; $i < $max_rows; $i++)
	{
		$row = $rowset_order[$i_order]['rowset'][$i];
		
		$template->assign_block_vars( 'category.row', array(
			'TITLE'			=> $row['topic_title'] == '' ? '&nbsp;' : $row['topic_title'],
			'U_LINK'		=> append_sid( 'viewtopic.' . $phpEx, 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . str_replace( '{last_post}', $row['last_post'], $add_link)),
			'ADDITIONAL'	=> ($tt_additional != '' ) ? $row[$tt_additional]: '',
			'BG_ROW' => ( ($counter++) %2 == 0) ? 'bg1' : 'bg2',
			));
	}
}
?>

And text cutting doesn't work for me... :cry:

Re: [RC] Top Topics 1.3

Posted: Sat Jul 25, 2009 7:40 pm
by vBB
Someone could help to add cuttext function to this mod? Upper method doesn't work for me...

Re: [RC] Top Topics 1.3

Posted: Fri Aug 07, 2009 10:56 am
by eunaumtenhoid
can anyone help me there into database codes?

Re: [RC] Top Topics 1.3

Posted: Fri Aug 07, 2009 5:05 pm
by Lisbon
2 questions:

How to uninstall the sql of this Mod?

After install this mod i dont have acesse to ACP :shock: Yes! i cleam the cache via ftp.

Tks for help

Re: [RC] Top Topics 1.3

Posted: Thu Aug 13, 2009 4:08 am
by tumba25
The MOD author has stated that he is not going to submit this MOD in the MODDB, so I'm locking this topic per the forum rules.

If the author changes his mind he can contact me or some other MOD Team member.

Re: [RC] Top Topics 1.3

Posted: Thu Aug 13, 2009 8:44 pm
by tumba25
The MOD author changed his mind about submitting to the MODDB so I'll reopen this topic.

Do note that MODs in the development forum should be considered unstable and not used in a live forum before they are accepted in the MODDB.

Re: [RC] Top Topics 1.3

Posted: Tue Oct 05, 2010 3:29 pm
by _Al
This was one of the best mods for phpbb2* Id love to have it working for 3.0.7-PL1

Anyone have this working in phpbb3 3.0.7-PL1 :?:

Re: [RC] Top Topics 1.3

Posted: Tue Oct 05, 2010 6:06 pm
by darkonia
screens or demo pls!