[ABD] "Like" Mod

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
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [DEV] "Like" Mod

Post by digioz » Fri Oct 05, 2012 11:57 am

The AutoMod ModX package only supports prosilver theme. You have to manually add the template edit to your style.

Pete
DigiOz Multimedia
http://www.digioz.com

arinjagga
Registered User
Posts: 35
Joined: Wed Aug 15, 2012 5:16 pm

Re: [DEV] "Like" Mod

Post by arinjagga » Sat Oct 06, 2012 5:20 am

I did that but i is not picking the thumbs up image...can you guess the error

User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [DEV] "Like" Mod

Post by digioz » Sat Oct 06, 2012 9:29 am

You have to manually copy the thumb image into the new style directory at the proper location.
DigiOz Multimedia
http://www.digioz.com

arinjagga
Registered User
Posts: 35
Joined: Wed Aug 15, 2012 5:16 pm

Re: [DEV] "Like" Mod

Post by arinjagga » Sat Oct 06, 2012 10:39 am

i did that at the first try only and even cross checked...help please...

blackvault
Registered User
Posts: 9
Joined: Sun Sep 09, 2012 11:23 pm

Re: [DEV] "Like" Mod

Post by blackvault » Sat Nov 03, 2012 4:02 pm

Ok, I installed the module... seems to be working good.

That said, I do have a problem when I created the LikedList.php file. http://www.theblackvault.com/phpBB3/likedlist.php I get the following error:
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4806: Cannot modify header information - headers already sent by (output started at [ROOT]/likedlist.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4808: Cannot modify header information - headers already sent by (output started at [ROOT]/likedlist.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4809: Cannot modify header information - headers already sent by (output started at [ROOT]/likedlist.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4810: Cannot modify header information - headers already sent by (output started at [ROOT]/likedlist.php:1)

User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [DEV] "Like" Mod

Post by digioz » Sun Nov 04, 2012 9:26 am

Can you post the full content of your like list.php? It looks like you are trying to do Session related functions after HTML has already been outputted to the browser.
DigiOz Multimedia
http://www.digioz.com

blackvault
Registered User
Posts: 9
Joined: Sun Sep 09, 2012 11:23 pm

Re: [DEV] "Like" Mod

Post by blackvault » Sun Nov 04, 2012 4:20 pm

Code: Select all

    <?php
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    include($phpbb_root_path . 'includes/bbcode.' . $phpEx);

    $icons = $cache->obtain_icons();

    // Start session management
    $user->session_begin();
    $auth->acl($user->data);

    $user->setup();
    //$user->setup('viewtopic'); // for specific template

    // If Page access limited to logged in users also add this
    if ($user->data['user_id'] == ANONYMOUS)
    {
        login_box('', $user->lang['LOGIN']);
    }

    // Run Query to get list ----------------------------------------------------

    $start = request_var('start', 0);
    $result_set = get_liked_list($start);

    foreach ($result_set as $row)
                    {
                        $topic_id = $row['topic_id'];
                        $forum_id = $row['forum_id'];

                        // This will allow the style designer to output a different header
                        // or even separate the list of announcements from sticky and normal topics
                        $s_type_switch_test = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0;

                        // Replies
                        $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];

                        if ($row['topic_status'] == ITEM_MOVED)
                        {
                            $topic_id = $row['topic_moved_id'];
                            $unread_topic = false;
                        }
                        else
                        {
                            $unread_topic = (isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
                        }

                        // Get folder img, topic status/type related information
                        $folder_img = $folder_alt = $topic_type = '';
                        topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);

                        // Generate all the URIs ...
                        $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $topic_id);

                        $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
                        $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
                        $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $user->session_id) : '';



                        $template->assign_block_vars('topicrow', array(
                            'FORUM_ID'                    => $forum_id,
                            'TOPIC_ID'                    => $topic_id,
                            'TOPIC_AUTHOR'                => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name']),
                            'TOPIC_AUTHOR_COLOUR'        => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name']),
                            'TOPIC_AUTHOR_FULL'            => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name']),
                            'FIRST_POST_TIME'            => $user->format_date($row['topic_time']),
                            'LAST_POST_SUBJECT'            => censor_text($row['topic_last_post_subject']),
                            'LAST_POST_TIME'            => $user->format_date($row['topic_last_post_time']),
                            'LAST_VIEW_TIME'            => $user->format_date($row['topic_last_view_time']),
                            'LAST_POST_AUTHOR'            => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
                            'LAST_POST_AUTHOR_COLOUR'    => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
                            'LAST_POST_AUTHOR_FULL'        => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
                            'LIKE_COUNT'                =>  $row['count'],

                            'PAGINATION'        => topic_generate_pagination($replies, $view_topic_url),
                            'REPLIES'            => $replies,
                            'VIEWS'                => $row['topic_views'],
                            'TOPIC_TITLE'        => censor_text($row['topic_title']),
                            'TOPIC_TYPE'        => $topic_type,

                            'TOPIC_FOLDER_IMG'        => $user->img($folder_img, $folder_alt),
                            'TOPIC_FOLDER_IMG_SRC'    => $user->img($folder_img, $folder_alt, false, '', 'src'),
                            'TOPIC_FOLDER_IMG_ALT'    => $user->lang[$folder_alt],
                            'TOPIC_ICON_IMG'        => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
                            'TOPIC_ICON_IMG_WIDTH'    => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
                            'TOPIC_ICON_IMG_HEIGHT'    => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
                            'ATTACH_ICON_IMG'        => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
                            'UNAPPROVED_IMG'        => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',

                           

                            'S_TOPIC_TYPE'            => $row['topic_type'],
                            'S_USER_POSTED'            => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
                            'S_UNREAD_TOPIC'        => $unread_topic,
                            'S_TOPIC_REPORTED'        => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $forum_id)) ? true : false,
                            'S_TOPIC_UNAPPROVED'    => $topic_unapproved,
                            'S_POSTS_UNAPPROVED'    => $posts_unapproved,
                            'S_HAS_POLL'            => (isset($row['poll_start']) && $row['poll_start'])  ? true : false,
                            'S_POST_ANNOUNCE'        => ($row['topic_type'] == POST_ANNOUNCE) ? true : false,
                            'S_POST_GLOBAL'            => ($row['topic_type'] == POST_GLOBAL) ? true : false,
                            'S_POST_STICKY'            => ($row['topic_type'] == POST_STICKY) ? true : false,
                            'S_TOPIC_LOCKED'        => ($row['topic_status'] == ITEM_LOCKED) ? true : false,
                            'S_TOPIC_MOVED'            => ($row['topic_status'] == ITEM_MOVED) ? true : false,

                            'U_NEWEST_POST'            => $view_topic_url . '&view=unread#unread',
                            'U_LAST_POST'            => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
                            'U_LAST_POST_AUTHOR'    => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
                            'U_TOPIC_AUTHOR'        => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name']),
                            'U_VIEW_TOPIC'            => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id),
                            'U_MCP_REPORT'            => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&f=' . $forum_id . '&t=' . $topic_id, true, $user->session_id),
                            'U_MCP_QUEUE'            => $u_mcp_queue,
                            'S_TOPIC_TYPE_SWITCH'    => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test)
                        );

                        $s_type_switch = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0;
                    }
                    $template->assign_vars(array(
                        'PAGINATION'    => generate_pagination(append_sid("{$phpbb_root_path}likedlist.$phpEx"), $topics_count, $config['topics_per_page'], $start),
                        'PAGE_NUMBER'    => on_page($topics_count, $config['topics_per_page'], $start),
                        'TOTAL_TOPICS'    => (true) ? false : (($topics_count == 1) ? $user->lang['PTT_NUM_TOPIC'] : sprintf($user->lang['PTT_NUM_TOPICS'], $topics_count)),
                        'S_DISPLAY_SEARCHBOX'        => true,
                        )
                    );
               
    // END Query to get list -----------------------------------------------------

    page_header('Liked List');

    $template->set_filenames(array(
        'body' => 'likedlist_body.html',
    ));

    make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
    page_footer();
    ?>

User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [DEV] "Like" Mod

Post by digioz » Sun Nov 04, 2012 4:44 pm

It looks like you are using the wrong version. Try using the one in this post:

viewtopic.php?f=70&t=2113726&p=13060224#p13060224

This one is the correct version that supports pagination.

Pete
DigiOz Multimedia
http://www.digioz.com

blackvault
Registered User
Posts: 9
Joined: Sun Sep 09, 2012 11:23 pm

Re: [DEV] "Like" Mod

Post by blackvault » Sun Nov 04, 2012 6:29 pm

Thank you so much for that!

User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [DEV] "Like" Mod

Post by digioz » Mon Nov 05, 2012 1:19 am

blackvault wrote:Thank you so much for that!
You are very welcome. Let me know if you experience any other issues.

Pete
DigiOz Multimedia
http://www.digioz.com

User avatar
MadMagoo
Registered User
Posts: 61
Joined: Tue Jan 31, 2012 9:17 am
Location: Centre of my own unreality
Name: Jo

Re: [DEV] "Like" Mod

Post by MadMagoo » Sat Nov 10, 2012 12:52 pm

OK, when I install the modx file I am getting the following when I go into my threads:

General Error
SQL ERROR [ mysqli ]

Table 'dischem7_phpb1.phpbb_likes' doesn't exist [1146]

SQL

SELECT A.user_id, A.username, B.user_colour FROM phpbb_likes AS A, phpbb_users AS B WHERE forum_id=68 AND topic_id=5667 AND A.user_id = B.user_id ORDER BY username ASC;

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/includes/db/dbal.php
LINE: 757
CALL: trigger_error()

FILE: [ROOT]/includes/db/mysqli.php
LINE: 182
CALL: dbal->sql_error()

FILE: [ROOT]/includes/functions_display.php
LINE: 1404
CALL: dbal_mysqli->sql_query()

FILE: [ROOT]/viewtopic.php
LINE: 697
CALL: get_like_list()

???

User avatar
Metzle
Registered User
Posts: 113
Joined: Sat Mar 15, 2008 2:55 am
Location: Waiblingen-Neustadt (Germany)
Name: Daniel
Contact:

Re: [DEV] "Like" Mod

Post by Metzle » Sat Nov 10, 2012 12:57 pm

Hi,

I think you didn't the SQL changes?
Metzle
phpBB.de-Support-Team
No Support via PN/E-Mail/ICQ etc.
Allround-phpBB.de

User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [DEV] "Like" Mod

Post by digioz » Sat Nov 10, 2012 1:51 pm

Correct. Please make sure the MySQL table for this Mod is installed.
DigiOz Multimedia
http://www.digioz.com

User avatar
MadMagoo
Registered User
Posts: 61
Joined: Tue Jan 31, 2012 9:17 am
Location: Centre of my own unreality
Name: Jo

Re: [DEV] "Like" Mod

Post by MadMagoo » Sat Nov 10, 2012 2:36 pm

Yes the MySQL table was installed and I have double checked it against the code and it is correct.

User avatar
digioz
Registered User
Posts: 297
Joined: Thu Feb 05, 2004 9:20 pm
Location: Chicago, IL
Name: DigiOz Multimedia
Contact:

Re: [DEV] "Like" Mod

Post by digioz » Sat Nov 10, 2012 5:02 pm

Did you install the Mod manually? If so uninstall it an reinstall using ModX package.
DigiOz Multimedia
http://www.digioz.com

Locked

Return to “[3.0.x] Abandoned MODs”