1 (edited by s3Street 2007-02-12 01:19)

Topic: Please Help (Two mods conflicting)

Hi I'm using two mods the first is the "Adding topic title Info to last post" mod found http://punbb.org/forums/viewtopic.php?id=9022

and the other is the subforums mod by pabb.

Now in both mods they require the same info to be changed.

REPLACE:

$last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';

WITH:

$last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.$cur_forum['subject'].'</a> <span class="byuser">'.format_time($cur_forum['last_post']).'  -  '.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';


STEP 2:

REPLACE:

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

WITH:

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, t.subject FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id
LEFT JOIN '.$db->prefix.'topics AS t ON f.last_post_id=t.last_post_id
LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

Subforum mod

#---------[ 7. FIND (line: 41) ]---------------------------------------------
#
// Print the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
#
#---------[ 8. REPLACE WITH ]-------------------------------------------------
#
// Print the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, f.parent_forum_id FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND (f.parent_forum_id IS NULL OR f.parent_forum_id=0) ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
#---------[ 11. FIND (line: 110) ]---------------------------------------------
#
if ($cur_forum['last_post'] != '')
        $last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';
#
#---------[ 12. REPLACE WITH ]---------------------------------------------
#
if ($l_post != '')
            $last_post = '<a href="viewtopic.php?pid='.$l_pid.'#p'.$l_pid.'">'.format_time($l_post).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($l_pr).'</span>';

Any help? sad

Re: Please Help (Two mods conflicting)

I'd go with this for step one...

Now to read pver part 2...

REPLACE:
if ($cur_forum['last_post'] != '')
            $last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';

WITH:
if ($l_post != '')
            $last_post = '<a href="viewtopic.php?pid='.$l_pid.'#p'.$l_pid.'">'.format_time($l_post).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($l_pr).'</span>';
//if ($cur_forum['last_post'] != '')
//            $last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.$cur_forum['subject'].'</a> <span class="byuser">'.format_time($cur_forum['last_post']).'  -  '.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';
echo "deadram"; echo; fortune;

3 (edited by deadram 2007-02-12 08:33)

Re: Please Help (Two mods conflicting)

STEP 2:

REPLACE:

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

WITH:

// Print the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, f.parent_forum_id, t.subject FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'topics AS t ON f.last_post_id=t.last_post_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND (f.parent_forum_id IS NULL OR f.parent_forum_id=0) ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

Try it, see if anything blows up and turns into a fiery ball of deaath and explosion and corruption. If the grim reaper doesn't take your forum to that place in the sky were all forums are full of people and never run out of bandwidth or CPU, then grats tongue

echo "deadram"; echo; fortune;

Re: Please Help (Two mods conflicting)

hm I'll try it in a bit. Say do you know about punbb modding? I'm interested in a mod.. willing to pay as well.

Re: Please Help (Two mods conflicting)

s3Street wrote:

hm I'll try it in a bit. Say do you know about punbb modding? I'm interested in a mod.. willing to pay as well.

What kind of mod?

Re: Please Help (Two mods conflicting)

elbekko wrote:

What kind of mod?

i'm interested in a mod that will do my discrete mathematics for me... you know logic tables, venn diagrams, intersects, unions, set theory, eulerian paths, pascal's triangle and more! haha all this just to verify if it's a human upon registering and not a spambot! tongue

~thegleek

Re: Please Help (Two mods conflicting)

Well, I think a spambot would know more about that stuff than me >=/

Re: Please Help (Two mods conflicting)

A mod that detects certain posts.


Kind of like a poll. It detects certain words and when it detects enough it edits topic titles... kinda hard to explain

Re: Please Help (Two mods conflicting)

So... say, when enough people post Solved, it changed the topic title to [SOLVED] Title?

Re: Please Help (Two mods conflicting)

elbekko wrote:

So... say, when enough people post Solved, it changed the topic title to [SOLVED] Title?

That mod already exists, doesn't it? It's called 50 moderators from different time zones big_smile

echo "deadram"; echo; fortune;

Re: Please Help (Two mods conflicting)

lol tongue

12 (edited by thegleek 2007-02-14 21:07)

Re: Please Help (Two mods conflicting)

deadram wrote:

That mod already exists, doesn't it? It's called 50 moderators from different time zones big_smile

lol nice. but a curious question for the dude who runs this place... (or has mysql access):

run this sql query command:

mysql> SELECT username, num_posts, timezone FROM users WHERE timezone < -11 ORDER BY num_posts DESC;
Empty set (0.00 sec)

how many users you have? any with posts? chances are, they are 99.9999999% spammer/spambot. here's why:

link: http://www.worldtimezone.com/utc/utc-1200.html

The International Date Line is between time zones M(Mike) and Y(Yankee) as imaginary line on the Earth that separates two consecutive calendar days.

Date in the Eastern hemisphere, to the left of the line- time zone M (Mike)- is always one day ahead of the date in the Western hemisphere, to the right of the International Date Line- time zone Y (Yankee).

It has been recognized as a matter of convenience and has no force in international law.

~thegleek

13 (edited by s3Street 2007-02-15 03:57)

Re: Please Help (Two mods conflicting)

elbekko wrote:

So... say, when enough people post Solved, it changed the topic title to [SOLVED] Title?

Well, very close but I can explain better in an email can you provide one?

Re: Please Help (Two mods conflicting)

Could add something like this to your crontab.hourly directory:

#!/bin/sh
# Update the topics subject when the posts in that topic get a match for solved, lower or uppercase

SQLCMD='sqlite /path/db.file.name'
SQLCMD='mysqladmin'

if [[ n`${SQLCMD} 'SELECT topic_id FROM posts WHERE message GLOB "*[Ss][Oo][Ll][Vv][Ee][Dd]*";' != "n" ]]; then
  TOPIC_ID=`${SQLCMD} 'SELECT topic_id FROM posts WHERE message GLOB "*[Ss][Oo][Ll][Vv][Ee][Dd]*";'
  echo do stuff like an UPDATE;
  SUBJECT=`${SQLCMD} "SELECT subject FROM topics WHERE id='${TOPIC_ID}'"`
  ${SQLCMD} "UPDATE topics SET subject='[Solved] - ${SUBJECT}' WHERE id'${TOPIC_ID}'"
  echo Just finished updating the subject of a topic to solved.
fi
echo "deadram"; echo; fortune;

Re: Please Help (Two mods conflicting)

s3Street: use the form email, I don't want even more spam by just posting it here big_smile

deadram: I'm sure that can be heavily optimised, especially when you only update the threads that have been posted in in the last hour (when running hourly).

Re: Please Help (Two mods conflicting)

It was a 1 minute (ok, well i wasn't timing myself, but probably more like 5 0.o) 10 liner tongue Supposed to get whoever does whatever for whomever getting wherever, somewhere soon x.X

echo "deadram"; echo; fortune;