[ABD] Top Topics 1.3

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
Kamahl19
Registered User
Posts: 1598
Joined: Tue Nov 06, 2007 3:33 pm
Location: Slovakia
Name: Martin

[ABD] Top Topics 1.3

Post 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
Last edited by Kamahl19 on Mon May 30, 2011 11:35 am, edited 2 times in total.
silneil
Registered User
Posts: 62
Joined: Sat Apr 15, 2006 8:03 pm

Re: Top Topics 1.3

Post by silneil »

Hello Kamahl,

Thanks for this MOd.

You have a Demo?
-tribe-
Registered User
Posts: 144
Joined: Thu Jan 31, 2008 4:06 pm

Re: [RC] Top Topics 1.3

Post 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
User avatar
wojtula
Registered User
Posts: 24
Joined: Mon Nov 17, 2008 8:52 pm
Location: Poland

Re: [RC] Top Topics 1.3

Post by wojtula »

graet mod !! Image

thx Image
vBB
Registered User
Posts: 43
Joined: Sun Jun 07, 2009 2:21 pm

Re: [RC] Top Topics 1.3

Post 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?
usenet2you
Registered User
Posts: 407
Joined: Sat Mar 22, 2008 7:31 pm
Location: The Netherlands

Re: [RC] Top Topics 1.3

Post 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.
vBB
Registered User
Posts: 43
Joined: Sun Jun 07, 2009 2:21 pm

Re: [RC] Top Topics 1.3

Post by vBB »

Thanks! I will see whether it will be working ;)
vBB
Registered User
Posts: 43
Joined: Sun Jun 07, 2009 2:21 pm

Re: [RC] Top Topics 1.3

Post 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:
vBB
Registered User
Posts: 43
Joined: Sun Jun 07, 2009 2:21 pm

Re: [RC] Top Topics 1.3

Post by vBB »

Someone could help to add cuttext function to this mod? Upper method doesn't work for me...
User avatar
eunaumtenhoid
Registered User
Posts: 1051
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [RC] Top Topics 1.3

Post by eunaumtenhoid »

can anyone help me there into database codes?
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
User avatar
Lisbon
Registered User
Posts: 831
Joined: Wed Jan 30, 2008 12:28 pm
Location: Zermatt

Re: [RC] Top Topics 1.3

Post 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
User avatar
tumba25
Former Team Member
Posts: 4430
Joined: Wed Jun 06, 2007 6:42 am
Location: Kokkola, Finland.
Name: Jari Kanerva

Re: [RC] Top Topics 1.3

Post 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.
Need a mod/extension created/installed, other custom-coded solution or a server admin? https://tumba25.net
User avatar
tumba25
Former Team Member
Posts: 4430
Joined: Wed Jun 06, 2007 6:42 am
Location: Kokkola, Finland.
Name: Jari Kanerva

Re: [RC] Top Topics 1.3

Post 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.
Need a mod/extension created/installed, other custom-coded solution or a server admin? https://tumba25.net
_Al
Registered User
Posts: 203
Joined: Mon Oct 20, 2008 9:24 pm
Location: Sweetas - All your friends online

Re: [RC] Top Topics 1.3

Post 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 :?:
User avatar
darkonia
Registered User
Posts: 1901
Joined: Tue May 13, 2008 1:10 pm
Location: Munich, Germany

Re: [RC] Top Topics 1.3

Post by darkonia »

screens or demo pls!
MMOG-Heaven - Das Gaming Portal
Community bedeutet Gleichgesinnte finden - MMOG-Heaven ist Deine Community! Von Spielern für Spieler bietet Dir dieses Portal genau das, was ein Spieler braucht. Bleibe ständig informiert, finde die neuesten MMORPGs, oder suche die frischesten News aus der Welt des Online Gamings - dieses und vieles mehr erwartet Dich auf MMOG-Heaven.

Return to “[3.0.x] Abandoned MODs”