Code: Select all
Could not obtain topic information
DEBUG MODE
SQL Error : 1066 Not unique table/alias: 'p3'
SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username, p3.poster_id AS my_reply_id FROM (phpbb_topics t, phpbb_users u, phpbb_posts p, phpbb_users u2 LEFT JOIN phpbb_posts p3 ON p3.topic_id = t.topic_id AND p3.post_id != t.topic_first_post_id AND p3.poster_id = 3) LEFT JOIN phpbb_posts p3 ON p3.topic_id = t.topic_id AND p3.poster_id = 3) WHERE t.forum_id = 1 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 GROUP BY p.post_id ORDER BY t.topic_priority DESC, t.topic_last_post_id DESC
Line : 305
File : /home/mrikasu/public_html/cherokeered/viewforum.php
cherokee red wrote:Code: Select all
SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username, p3.poster_id AS my_reply_id FROM (phpbb_topics t, phpbb_users u, phpbb_posts p, phpbb_users u2 LEFT JOIN phpbb_posts p3 ON p3.topic_id = t.topic_id AND p3.post_id != t.topic_first_post_id AND p3.poster_id = 3) LEFT JOIN phpbb_posts p3 ON p3.topic_id = t.topic_id AND p3.poster_id = 3) WHERE t.forum_id = 1 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 GROUP BY p.post_id ORDER BY t.topic_priority DESC, t.topic_last_post_id DESC
Code: Select all
#
#-----[ OPEN ]-----
#
templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]-----
#
#Note: full line is longer
<td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}
#
#-----[ IN-LINE DELETE ]-----
#
{topicrow.TOPIC_HIGHLIGHT_USERPOST_IMG}
#
#-----[ FIND ]-----
#
<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">
#
#-----[ AFTER, ADD ]-----
#
{topicrow.TOPIC_HIGHLIGHT_USERPOST_IMG}
#
#-----[ SAVE & CLOSE ALL FILES ]-----
#
#
#-----EoM-----
#
MagiCat wrote: Has anyone came up with any ideas for different graphics to use for subSilver, love the mod but I'm growing to hate the red dot and the other options don't appeal to me either.
cherokee red wrote: Is the one with the mod not blue? I made mine red in adobe photoshop. :?
*edit* well i will be blue if you use part 3 ;)
MagiCat wrote:cherokee red wrote: Is the one with the mod not blue? I made mine red in adobe photoshop.
*edit* well i will be blue if you use part 3![]()
Part 2 uses red dots. Tried part 3 but it makes it hard to read down the list of topics because of the way it indents. Thinking about making a custom graphic combined with an extra column (maybe between the left graphic and the topic title) and have it there.
drathbun wrote: Quick question... why the "Group By Post_ID" clause?
fredol wrote: The GROUP BY is used in order to avoid the same topics to show up more than once because of the LEFT JOIN I added, since you could have replied more than once to one same topic...
Code: Select all
Get topics for page (already done, selected into topic_rowset)
Collapse topic_id values into a comma separated list (implode topic_rowset)
Check for user posts in those topics
Code: Select all
if ($userdata['session_logged_in'])
{
$sql = 'SELECT p.topic_id, sign(post_id)
FROM ' . POSTS_TABLE . ' p
where p.topic_id in ' . $topic_list . '
and p.poster_id = ' . $userdata['user_id'];
blah blah execute and test sql here
Code: Select all
if ($topic_posted['topic_id'] == 1) {replace image as appropriate}
Code: Select all
SQL Error : 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 ') WHERE forum_id = 1' at line 3
SELECT * FROM (phpbb_forums LEFT JOIN phpbb_posts p3 ON p3.topic_id = t.topic_id AND p3.poster_id = ) WHERE forum_id = 1
Line : 72
File : X:\path\to\phpbb\viewforum.php
Code: Select all
66:$sql = "SELECT *
67:FROM (" . FORUMS_TABLE . "
68:LEFT JOIN " . POSTS_TABLE . " p3 ON p3.topic_id = t.topic_id AND p3.poster_id = " . $userdata['user_id'] . ")
69:WHERE forum_id = $forum_id";
70:if ( !($result = $db->sql_query($sql)) )
71:{
72:message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
73:}
drathbun wrote: On my board I reduced the page generation times from 2 seconds down to 0.05 seconds by eliminating one outer join.I really dislike outer joins, and try to eliminate them whenever possible. So while it may seem to be less efficient to run a second query, in this case I believe that it should help quite a bit.