[2.0.10] Topic Cement!

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
28
78%
Very Good
7
19%
Good
0
No votes
Fair
0
No votes
Poor
1
3%
 
Total votes: 36

nedd3h
Registered User
Posts: 14
Joined: Tue Apr 25, 2006 12:40 am
Location: Australia

Post by nedd3h »

the easymod said all mods in mod folder processed...but!

i installed the .mod file in the admin/mods folder on it's own ie. not within a admin/mods/mod_topic_cement_1.0.3 folder :oops:
so, as far as easymod was concernered there was nothing in there (maybe this can be a future change for the easymod to prevent such confusion, as in give a different statemnet if no folders are found)

10/10 for a very nice mod :)
it's the only one on my forum and is just what i was looking for!

btw, it works with the aluminoid theme no probs.


thanks again!

Ygramul
Registered User
Posts: 41
Joined: Tue Sep 05, 2006 12:30 pm
Contact:

No "Priority" option in Moderator Control Panel.

Post by Ygramul »

Forgive me, but I've searched the majority of this thread and haven't found a solution for the problem I'm having. I originally couldn't locate the "moderate this forum" link at the bottom of the page (I was stupidly looking to find it listed with the "go to administrative panel" which, of course, it wasn't). I've gotten past that now and the new issue is that, having found the Moderator Control Panel, I don't have an option to prioritize threads. I get "delete", "move", "lock" and "unlock", but that's all. I tried to edit the code of the four files a few times and then finally installed EasyMod, hoping that would do it, if that makes any difference.

Also, I have a theme that is basically just a small edit of the default subSilver template... mostly just basic text and color adjustments, as well as replacements for the color gradient images that suited my color scheme. When I couldn't find the option to prioritize threads, I tried setting my forums back to the original subSilver template just to be sure that my new color scheme wasn't interfering with it in any way. The old color scheme was reinstated, but the Moderator Control Panel remained the same as before, with no option to prioritize.

I'm completely at a loss as to what I may have missed or done improperly, at this point, to make it not work. Is there any way you could help me, please? Thank you.

postman
Registered User
Posts: 179
Joined: Mon Jun 26, 2006 8:42 pm
Location: London UK
Contact:

Post by postman »

ok i've got an error message when i do the sql thing.
I've read this but still doesn't make sense.
http://www.phpbb.com/kb/article.php?article_id=151
Error is the same as this.....
http://www.adamreyher.com/pub/phpbb/kbarticle151/7.gif
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'topic_priority SMALLINT DEFAULT '0' NOT NULL' at line 1


I'm putting in 'topic_priority SMALLINT DEFAULT '0' NOT NULL;'

Also i get this in the forum but i've done the view forum bit right.

Could not obtain topic information

DEBUG MODE

SQL Error : 1054 Unknown column 't.topic_priority' in 'order clause'

SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username FROM phpbb_topics t, phpbb_users u, phpbb_posts p, phpbb_users u2 WHERE t.forum_id = 7 AND t.topic_poster = u.user_id AND p.post_id = t.topic_last_post_id AND p.poster_id = u2.user_id AND t.topic_type = 2 ORDER BY t.topic_priority DESC, t.topic_last_post_id DESC

Line : 297
File : viewforum.php

Any chance,as the forum is down at the mo.
my php-admin is version is 2.9.0.2.
Helllllllllp :(

Cinful
Registered User
Posts: 37
Joined: Tue Oct 10, 2006 1:34 am

Post by Cinful »

I know this is probably a simple error to fix, but I am very new at this and would appreciate if anyone can help me figure this out? Ive installed it using EasyMOD and this is the error I receive:
FIND FAILED: In file [templates/freeMind/modcp_body.tpl] could not find:

<td class="spaceRow" colspan="5" align="center"><span class="gensmall">{L_MOD_CP_EXPLAIN}</span></td>


But as you can see from this screen shot below I do have it:

Image

And I did switch the greygensmall to gensmall.

Thanks.

SpacePower
Registered User
Posts: 66
Joined: Wed Mar 16, 2005 9:04 pm
Location: Berlin, EU
Contact:

Post by SpacePower »

I use the cement mod now for almost a year and it is very useful for my forum. When I read the different topics inside a forum and I click on the links "View previous topic :: View next topic" you get the next or previous id. And this might not the top down list you see in the forum. Is it possible to link "View previous topic :: View next topic " with the priority id?
Power to the Peaceful
My forum(s):
http://www.stayhuman.org/phpBB2
http://www.spearhead-home.com/phpBB2
My website:
Image

Welshcat
Registered User
Posts: 81
Joined: Sat Sep 02, 2006 5:26 pm
Contact:

Post by Welshcat »

I'm having the same problem others have experienced in the past where the topics are not cementing at all. They prioritize and they show the order in the mod cp, but in the view forum the topics aren't stuck in that order. I went through this thread carefully, checking for all the mistakes that others have made, and also went through the modifications carefully several too, but to no avail. I simply copied and pasted the code from the instructions (v.1.03) but nothing happens at all. I don't even see anything that says that the topics have been cemented.

I have quite a number of mods and hacks installed (over 50), including the separate sticky and announcements. What could be causing this problem?

Thanks

User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

I just installed this mod, as well, and I'm having this problem. This is a very simple mod to install, and the code is well-founded, and the SQL query should be working, but when I check my database manually, I see that it really isn't even assiging the values to my posts...

I am going back in to double check things, but if anyone knows anything, please let us know here!
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :

User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

I have found my problem, and probably yours, WelshCat:

In modcp.php, this snippet is probably mislocated:

Code: Select all

	default:
#
#-----[ BEFORE, ADD ]------------------------------------------ 
#
	case 'cement':
		if ( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
		{
			message_die(GENERAL_MESSAGE, $lang['None_selected']);
		}

		$topics = ( isset($HTTP_POST_VARS['topic_id_list']) ) ?  $HTTP_POST_VARS['topic_id_list'] : array($topic_id);

		for($i = 0; $i < count($topics); $i++)
		{
			$priority_box_id = "topic_cement:" . intval($topics[$i]);
			$topic_priority = (isset($HTTP_POST_VARS[$priority_box_id])) ? 
				intval($HTTP_POST_VARS[$priority_box_id]) : 0;
			$sql = "UPDATE " . TOPICS_TABLE . " 
 				SET topic_priority = $topic_priority
 				WHERE topic_id = ".$topics[$i];
 			if ( !($result = $db->sql_query($sql)) )
 			{
 				message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
 			}

		}

		if ( !empty($topic_id) )
		{
			$redirect_page = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id'];
			$message = sprintf($lang['Click_return_topic'], '<a href="' . $redirect_page . '">', '</a>');
		}
		else
		{
			$redirect_page = "modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id'];
			$message = sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
		}

		$message = $message . '<br \><br \>' . sprintf($lang['Click_return_forum'], '<a href="' . "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id'] . '">', '</a>');

		$template->assign_vars(array(
			'META' => '<meta http-equiv="refresh" content="3;url=' . $redirect_page . '">')
		);

		message_die(GENERAL_MESSAGE, $lang['Topics_Prioritized'] . '<br /><br />' . $message);

		break;

I have Username Color Mod installed on my boards--part of the TriForce, if you installed it later--and it has TWO instances of

Code: Select all

default:
appearing in its modifications. The case of default you want is, specifically:

Code: Select all

	default:
		$page_title = $lang['Mod_CP'];
		include($phpbb_root_path . 'includes/page_header.'.$phpEx);
My guess is this is the problem you're running into.


This is a great mod, and there is no reason at all this code shouldn't work on the latest phpBB for some time to come.

That said, perhaps the installation instructions can change the "default:' reference to a more complete one, such as I've quoted above?

Keep up the good work!
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :

Welshcat
Registered User
Posts: 81
Joined: Sat Sep 02, 2006 5:26 pm
Contact:

Post by Welshcat »

Nope, there was only one default in my modcp.php and it was the one you quoted above. That's exactly where I pasted the code before it and it still is never cementing the posts. It says the posts have been prioritized but then when I go back to that forum, all the posts are in exactly the same order as they were before and nothing has been reordered.

Is this mod even supposed to tell you that your topics have been cemented? I don't ever see a message like that. It's as if nothing happens with this.

User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Cat, another error I made, but didn't mention above, because I thought it superfluous, was in viewforum.php. One of my sort edits were backwards, so nothing happened with my topics. Double check those, too.

Also, you can try looking at your database via phpmyadmin, right when you make some of the priority changes, to make sure they actually get registered in your dB.

At this point, it sounds like a reverrsed edit in viewforum...
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :

crookster
Registered User
Posts: 3
Joined: Tue Aug 29, 2006 2:38 pm

Topic Cement + EZ Portal

Post by crookster »

Hi.

I love Topic cement, but I'm having a small issue and would like to fix it.

I'm using EZ Portal, and I'd like to prioritize my Announcements as shown on EZ Portal. Unfortunately, EZ Portal does not have the code to prioritize with Topic Cement.

I'm beginning to learn the basic structure of PhpBB, but I'm not much of a PHP programmer, so I'm not really able to figure out the specific code.

Can someone help me figure out how to prioritize with Topic Cement on the EZ Portal front page?

Thanks so much, in advance.

crookster
Registered User
Posts: 3
Joined: Tue Aug 29, 2006 2:38 pm

Topic Cement and EZ Portal

Post by crookster »

In addendum to my query... I believe this is the code that fetches the ANNOUNCEMENT. It currently will only fetch by date. I'd like it to fetch by Priority.

exerpt from: portal.php

Code: Select all



//
// Fetch Posts from Announcements Forum
//
if(!isset($HTTP_GET_VARS['article']))
{
	$template->assign_block_vars('welcome_text', array());

	$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], $CFG['news_length']);

	for ($i = 0; $i < count($fetchposts); $i++)
	{
		if( $fetchposts[$i]['striped'] == 1 )
		{
			$open_bracket = '[ ';
			$close_bracket = ' ]';
			$read_full = $lang['Read_Full'];
		}
		else
		{
			$open_bracket = '';
			$close_bracket = '';
			$read_full = '';
		}

		$template->assign_block_vars('fetchpost_row', array(
			'TITLE' => $fetchposts[$i]['topic_title'],
			'POSTER' => $fetchposts[$i]['username'],
			'TIME' => $fetchposts[$i]['topic_time'],
			'TEXT' => $fetchposts[$i]['post_text'],
			'REPLIES' => $fetchposts[$i]['topic_replies'],
			'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
			'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&t=' . $fetchposts[$i]['topic_id']),
			'U_READ_FULL' => append_sid('portal.' . $phpEx . '?article=' . $i),
			'L_READ_FULL' => $read_full,
			'OPEN' => $open_bracket,
			'CLOSE' => $close_bracket)
		);
	}
}
else
{
	$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], 0);

	$i = intval($HTTP_GET_VARS['article']);

	$template->assign_block_vars('fetchpost_row', array(
		'TITLE' => $fetchposts[$i]['topic_title'],
		'POSTER' => $fetchposts[$i]['username'],
		'TIME' => $fetchposts[$i]['topic_time'],
		'TEXT' => $fetchposts[$i]['post_text'],
		'REPLIES' => $fetchposts[$i]['topic_replies'],
		'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
		'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&t=' . $fetchposts[$i]['topic_id'])
		)
	);
}
//
// END: Fetch Announcements
//
Any help is very much appreciated.

Welshcat
Registered User
Posts: 81
Joined: Sat Sep 02, 2006 5:26 pm
Contact:

Post by Welshcat »

Jackanape wrote: Cat, another error I made, but didn't mention above, because I thought it superfluous, was in viewforum.php. One of my sort edits were backwards, so nothing happened with my topics. Double check those, too.

Also, you can try looking at your database via phpmyadmin, right when you make some of the priority changes, to make sure they actually get registered in your dB.

At this point, it sounds like a reverrsed edit in viewforum...


Can you post what those sort edits looked like in viewforum.php and what they should look like so I can see exactly which bits i'm editing? Thanks

Renegade88
Registered User
Posts: 73
Joined: Tue Jun 18, 2002 8:57 am
Contact:

Post by Renegade88 »

SpacePower wrote: I use the cement mod now for almost a year and it is very useful for my forum. When I read the different topics inside a forum and I click on the links "View previous topic :: View next topic" you get the next or previous id. And this might not the top down list you see in the forum. Is it possible to link "View previous topic :: View next topic " with the priority id?


actually, even on vanilla installations of phpbb, if you had sticky or announcement posts which are naturally at the top of the list, you will notice the exact same behaviour. I notice it a couple of years ago. I think I looked into a "fix" at that time, but it wasn't simple. I don't remember exactly what it involved other than revised queries and reworking how phpbb works. The NEXT / PREVIOUS makes the bad assumption that all adjacent posts have adjacent post times, which like I said, isn't even true on unmodded forums.
Author of NFL Logos! and Topic Cement! MODs.
Architect of www.synsport.com (Premier Fantasy Football Management)

User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Welshcat wrote: Can you post what those sort edits looked like in viewforum.php and what they should look like so I can see exactly which bits i'm editing? Thanks


The install file cites the following changes"

Code: Select all

#
#-----[ OPEN ]------------------------------------------ 
#
viewforum.php
#
#-----[ FIND ]------------------------------------------ 
#
	ORDER BY t.topic_last_post_id DESC ";
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
ORDER BY 
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------ 
#
ORDER BY t.topic_priority DESC, 
#
#-----[ FIND ]------------------------------------------ 
#
	ORDER BY t.topic_type DESC, t.topic_last_post_id DESC 
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
t.topic_type DESC
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
, t.topic_priority DESC
#
Make sure that the additional code goes BETWEEN the existing ORDER BY variables. I accidentally placed mine AFTER them at first, and got the same results you did.
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :

Post Reply

Return to “[2.0.x] MOD Database Cleanup”