1

(142 replies, posted in PunBB 1.2 discussion)

My old forum (now closed)

PunBB 1.1.4 (modded)

Rows: 1155311
Size: 45.51 MB

Posts: 57802
Threads: 1115
Members: 429

This ran for a year from 2004 to 2005.

I'm getting no problems when I try to comment out the links.

Try commenting these lines out:
244
245
252
253
265
272

I actually did something of the sorts for a website I helped someone with using PunBB. It was a User Notes section that was found in the users profile, and they could add snippets of text to it. Useful for keeping notes, or just personalizing your profile with images and text.

Works perfect thanks wink

I've been trying to figure out to display the most recent threads by a user. The only problem is I don't know how to code the result to only fetch topics posted by a certain user. The code would look like this:

$result = $db->query('SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$db->prefix.'topics WHERE poster='.$username.' ORDER BY last_post DESC) or error('Unable to fetch topics from user, __FILE__, __LINE__, $db->error());

The part in red is what I don't get. I set the variable $username to the username of the user of the profile you're in. The code I used for that is:

$username = $user['username'];

But when I try to display the results from the database I get an error. I'm a newb at MySQL so I was just wondering if it would be possible.

I'm trying to write this mod into the profile.php in a table underneath the users profile around line 923.

I found a little bug while sending a message to someone.

In the Subject message box anything inside < : > will be removed from the subject title when submitted.

Example: If I enter "<Test> Message" as the subject line, the person recieving the message will recieve " Message".

So it's possible to remove the subject line from sent messages.

Actually the zip file was archived weird because the folder inside the zip is called mod_active_topics.php as well as the file, so when you try to unzip it, the zip files reads the folder as the file and not the file inside the folder. You may want to rename your folder to just mod_active_topics when you rearchive it.

EDIT: One more edit BTW tongue great mod.

EDIT: Cleaned up the code so it won't stretch.
Oh and Alex if you didn't want me to post the code I'll edit my post if you want. I just thought it would be helpful because it took me a while to figure out why your zip file was corrupted.

Anyway for people having trouble getting the file out of the zip the code in mod_active_topics.php is:


<?php
/*

PunBB Active Topics

Copyright 2004 Alex King, http://www.alexking.org/

This is a mod for PunBB, http://punbb.org/
PunBB is Copyright (C) 2002, 2003, 2004  Rickard Andersson (rickard@punbb.org)

-------------------------------

You can see this in action at the Use Tasks forums:

  http://www.usetasks.com/forums/


To install, include this file below the forums list in your index.php file:

  include('mod_active_topics.php');

*/

$ak_limit = 25; // change this to the number of active topics you want to display.

$latest = $db->query("SELECT id, subject, last_post, last_poster, posted"
                    ." FROM ".$db->prefix."topics"
                    ." WHERE moved_to IS NULL"
                    ." ORDER BY last_post DESC"
                    ." LIMIT ".$ak_limit
                    );

?>
<table class="punmain" cellspacing="1" cellpadding="4">
    <tr>
        <td class="puncon3" colspan="6" id="latest">Active Topics</td>
    </tr>
    <tr class="punhead">
        <td class="punhead"><?php echo $lang_common['Topic'] ?></td>
        <td class="punhead" style="width: 14%; white-space: nowrap">
                  Last Poster
                </td>
        <td class="punhead" style="width: 25%; white-space: nowrap">
                  <?php echo $lang_common['Last post'] ?>
                </td>
    </tr>
<?php
while ($ak_post = $db->fetch_assoc($ak_latest)) {
?>
    <tr class="puntopic">
        <td class="puncon2"><a href="viewtopic.php?id=<?php echo $ak_post['id'] ?>">
                   <?php echo pun_htmlspecialchars($ak_post['subject']) ?></a>
                </td>
        <td class="puncon1">
                   <?php echo pun_htmlspecialchars($ak_post['last_poster']) ?>
                </td>
        <td class="puncon2" style="white-space: nowrap">
                  <?php echo format_time($ak_post['last_post']) ?>
                </td>
    </tr>
<?php
}
?>
</table>