[ABD] View single post 0.1.0

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.
Locked
Ather
Registered User
Posts: 1032
Joined: Fri May 08, 2009 9:42 am
Location: Kingdom of Bahrain
Name: Ather Akber

[ABD] View single post 0.1.0

Post by Ather »

Modification Name: View single post 0.1.0
Author: eviL<3

Modification Description:: This MOD will give you the possibility to view a single post, this is useful if you want to highlight a specific post.
Modification Version:: 0.1.0

Modification Download: http://66.154.121.250/viewpost_0_1_0.rar

This mod was orignally made by eviL<3, i just coudnt find it here, so i just packed it with the new modx and uploaded it here, so all credits to him,

Ps, i tested it with 3.0.7 PL-1 working good
CPL Syed Ather Akbar
Regional Command Southwest
Camp Leatherneck, Afghanistan

My Mods/Snippets
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: [Beta] View single post 0.1.0

Post by stokerpiller »

I saw this feature on another forum software recently.
Cool to see it for phpBB too :)


Wonder if Evil<3 is going to develop it further and if the code is up to date?



EDIT!
With debug enabled you will get this error:

Code: Select all

[phpBB Debug] PHP Notice: in file /viewpost.php on line 440: Undefined variable: now
[phpBB Debug] PHP Notice: in file /viewpost.php on line 450: Undefined variable: now
I am done with phpBB
Ather
Registered User
Posts: 1032
Joined: Fri May 08, 2009 9:42 am
Location: Kingdom of Bahrain
Name: Ather Akber

Re: [Beta] View single post 0.1.0

Post by Ather »

line 450 in the viewpost.php is :

Code: Select all

$post_data['age'] = (int) ($now['year'] - $bday_year - $diff); 
now, this is the code in the latest viewtopic.php :

Code: Select all

$user_cache[$poster_id]['age'] = (int) ($now['year'] - $bday_year - $diff); 
im not much of a coder tho ;P any pointers?
CPL Syed Ather Akbar
Regional Command Southwest
Camp Leatherneck, Afghanistan

My Mods/Snippets
User avatar
tbackoff
Former Team Member
Posts: 7064
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

Re: [Beta] View single post 0.1.0

Post by tbackoff »

Exactly what it says, $now is not defined. You might want to add something like this:

Code: Select all

$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
* taken from viewtopic.php
Flying is the second best thrill to cheerleaders; being caught is the first.
utc9
Registered User
Posts: 2
Joined: Sun Aug 10, 2008 1:00 pm

Re: [Beta] View single post 0.1.0

Post by utc9 »

phpbb 3.0.7 PL1

Code: Select all

[phpBB Debug] PHP Notice: in file /viewpost.php on line 282: Undefined variable: post_edit_list
[phpBB Debug] PHP Notice: in file /viewpost.php on line 282: Undefined variable: post_edit_list
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4303: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3495)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4305: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3495)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4306: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3495)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4307: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3495)
doum-ti-di-li-doom
Registered User
Posts: 5
Joined: Sat Sep 12, 2009 7:39 pm

Re: [Beta] View single post 0.1.0

Post by doum-ti-di-li-doom »

MOD can be found at http://startrekguide.com/community/viewtopic.php?f=39&t=2184

Needs some work to use with phpBB-SEO.com, I could not get a perfect fit
utc9 wrote:phpbb 3.0.7 PL1

Code: Select all

[phpBB Debug] PHP Notice: in file /viewpost.php on line 282: Undefined variable: post_edit_list
Open viewpost.php

Code: Select all

Replace 4 times
post_edit_list[$post_data['post_edit_user']]

With
$user_edit_row

Code: Select all

Find
if (($post_data['post_edit_count'] && $config['display_last_edited']) || $post_data['post_edit_reason'])
{

Insert after
	if ($post_data['post_edit_reason'] || $post_data['post_edit_user'])
	{
		$sql = 'SELECT u.username, u.user_colour
			FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
			WHERE p.post_id = ' . $post_id . ' AND p.post_edit_user = u.user_id';
		$result = $db->sql_query($sql);
		$user_edit_row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);
	}
Small detail, as seen in viewtopic.php:

Code: Select all

Replace 2 times
$user->format_date($post_data['post_edit_time'])

With
$user->format_date($post_data['post_edit_time'], false, true)
Use append_sid()

Code: Select all

Replace
	'U_TOPIC'				=> "{$phpbb_root_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id" . (($highlight_match) ? "&hilit=$highlight" : ''),

With
	'U_TOPIC'			=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id . (($highlight_match) ? "&hilit=$highlight" : '')),
utc9
Registered User
Posts: 2
Joined: Sun Aug 10, 2008 1:00 pm

Re: [Beta] View single post 0.1.0

Post by utc9 »

>> doum-ti-di-li-doom
Thanks for the tips, I got the problem solved.
doum-ti-di-li-doom wrote:Open viewpost.php

Code: Select all

Replace 4 times
post_edit_list[$post_data['post_edit_user']]

With
$user_edit_row

Code: Select all

Find
if (($post_data['post_edit_count'] && $config['display_last_edited']) || $post_data['post_edit_reason'])
{

Insert after
	if ($post_data['post_edit_reason'] || $post_data['post_edit_user'])
	{
		$sql = 'SELECT u.username, u.user_colour
			FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
			WHERE p.post_id = ' . $post_id . ' AND p.post_edit_user = u.user_id';
		$result = $db->sql_query($sql);
		$user_edit_row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);
	}
Small detail, as seen in viewtopic.php:

Code: Select all

Replace 2 times
$user->format_date($post_data['post_edit_time'])

With
$user->format_date($post_data['post_edit_time'], false, true)
Use append_sid()

Code: Select all

Replace
	'U_TOPIC'				=> "{$phpbb_root_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id" . (($highlight_match) ? "&hilit=$highlight" : ''),

With
	'U_TOPIC'			=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id . (($highlight_match) ? "&hilit=$highlight" : '')),
ttuu
Registered User
Posts: 224
Joined: Wed Feb 13, 2008 6:28 pm

Re: [Beta] View single post 0.1.0

Post by ttuu »

you have one mistake in the mode.
if i go to the single post the user post is nor realy user. the user post is the user topic start.
the fix is:
in viewpost.php find:

Code: Select all

		AND t.topic_poster = u.user_id',
and replace with:

Code: Select all

		AND p.poster_id = u.user_id',
FomenkoAndrey
Registered User
Posts: 367
Joined: Thu Aug 19, 2010 10:44 am

Re: [Beta] View single post 0.1.0

Post by FomenkoAndrey »

phpbb 3.0.9
when the debug ON in the beginning of a page falls out the following errors:

[phpBB Debug] PHP Notice: in file /viewpost.php on line 440: Undefined variable: now
[phpBB Debug] PHP Notice: in file /viewpost.php on line 450: Undefined variable: now
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4643: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3772)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4645: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3772)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4646: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3772)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4647: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3772)


Could you help fix them?
User avatar
tbackoff
Former Team Member
Posts: 7064
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

Re: [Beta] View single post 0.1.0

Post by tbackoff »

t_backoff wrote:Exactly what it says, $now is not defined. You might want to add something like this:

Code: Select all

$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
* taken from viewtopic.php
Flying is the second best thrill to cheerleaders; being caught is the first.
FomenkoAndrey
Registered User
Posts: 367
Joined: Thu Aug 19, 2010 10:44 am

Re: [Beta] View single post 0.1.0

Post by FomenkoAndrey »

I solved the problem this way:

remove from viewpost.php:

Code: Select all

       if (!empty($post_data['user_birthday']))
       {
          list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $post_data['user_birthday']));
       
          if ($bday_year)
          {
             $diff = $now['mon'] - $bday_month;
             if ($diff == 0)
             {
                $diff = ($now['mday'] - $bday_day < 0) ? 1 : 0;
             }
             else
             {
                $diff = ($diff < 0) ? 1 : 0;
             }
       
             $post_data['age'] = (int) ($now['year'] - $bday_year - $diff);
          }
       }
       else
       {
          $post_data['age'] = false;
       }
error no longer appears

it correctly?
FomenkoAndrey
Registered User
Posts: 367
Joined: Thu Aug 19, 2010 10:44 am

Re: [Beta] View single post 0.1.0

Post by FomenkoAndrey »

phpbb3 3.0.10

when viewing a message through this mode is sometimes an error occurs:

Code: Select all

[phpBB Debug] PHP Notice: in file [ROOT]/viewpost.php on line 282: Undefined variable: post_edit_list
[phpBB Debug] PHP Notice: in file [ROOT]/viewpost.php on line 282: Undefined variable: post_edit_list
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4882: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3971)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4884: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3971)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4885: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3971)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4886: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3971)
apparently causes an undefined error message the name of the editor - Guest.
but, in fact, Guest - not correct. is completely determined by the user.

for example, if you look through the message viewpost (wrong):
Последнее редактирование: Guest , дата: Сегодня, 19:40, всего редактирований: 5.

if you see this message through a theme (correctly):
Последнее редактирование: Vandamm, дата: 04 мар 2012, 19:40, всего редактирований: 5.

error occurs in the string / viewpost.php on line 282:

Code: Select all

			$display_username = get_username_string('full', $row['post_edit_user'], $post_edit_list[$row['post_edit_user']]['username'], $post_edit_list[$row['post_edit_user']]['user_colour']);
this code does not select a user name, edited the message: $post_edit_list[$row['post_edit_user']]['username']

address of the page with an error: motobratva.com/viewpost.php?p=44149


help please to resolve the problem.
User avatar
RMcGirr83
Former Team Member
Posts: 21693
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: [Beta] View single post 0.1.0

Post by RMcGirr83 »

This topic has been marked as [ABD] - Abandoned as the mod author has not been active recently. If the MOD author wishes to continue development, please PM anyone on the MOD Team to request this topic be unlocked.

Notice!
We do not recommend that a user of the phpBB software install this mod, or any other mod that is marked as “abandoned” or “in development”, on a live forum. Doing so may cause your forum to not perform in the manner it should.


Thank you,
The phpBB Modifications Team
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
Locked

Return to “[3.0.x] Abandoned MODs”