Just too clarify, it is the same code each time.

If I can't add any html code between them, how about a image?

As the topic states I'm trying to add a code snip between each category.

I can't find where too put it in index.php, tried to add it at the end of the "while ($cur_forum = $db->fetch_assoc($result))" but no luck.


Anyone that can help?

This one uses the cookie info:

<?php
/**
* Punn BB creates an RSS feed for New Posts since last visit
* half written half hacked by Chris Neal
*/

// set header
header("Content-Type: text/xml");
// call Punn BB constants
define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';

//set configuation options
$title = pun_htmlspecialchars($pun_config['o_board_title']);
$desc = $title." Rss Feed";
$baseURL = $pun_config['o_base_url'];

//find out if user has a cookie
if (isset($_COOKIE['fa_cookie']))
    list($cookie['user_id'], $cookie['password_hash']) = @unserialize($_COOKIE['fa_cookie']);
if ($cookie['user_id'] > 1)
{
    $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_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 t.last_post>'.$pun_user['last_visit']) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
} else{
    $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_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 t.last_post>'.(time() - 86400)) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
}
//run query functions
$num_hits = $db->num_rows($result);
if (!$num_hits){
echo '<?xml version="1.0" encoding="ISO-8859-1" ?>'."\n";
echo '    <rss version="2.0">'."\n";
echo '        <channel>'."\n";
echo '            <title>'.$title .'</title>'."\n";
echo '            <link>'.$baseURL.'</link>'."\n";
echo '            <description>'.$desc .' '.count($search_set).'</description>'."\n";
echo '            <language>en</language>'."\n";
echo '            <copyright>© '.$title .'</copyright>'."\n";
echo '            <lastBuildDate>'.date("r").'</lastBuildDate>'."\n";
echo '            <item>'."\n"; 
echo '            <title>No Recent Posts</title> '."\n";
echo '            <link>'.$baseURL.'/</link>'."\n";
echo '            <description>No new Posts</description> '."\n";
echo'            </item>'."\n";
echo'        </channel>'."\n";
echo'    </rss>';
} else {
$sort_by = 4;
$search_ids = array();
while ($row = $db->fetch_row($result))
    $search_ids[] = $row[0];
$db->free_result($result);
$show_as = 'topics';
// Final search results
$search_results = implode(',', $search_ids);
// Fill an array with our results and search properties
$temp['search_results'] = $search_results;
$temp['num_hits'] = $num_hits;
$temp['sort_by'] = $sort_by;
$temp['sort_dir'] = $sort_dir;
$temp['show_as'] = $show_as;
$temp = serialize($temp);
$search_id = mt_rand(1, 2147483647);
//set results 
$sort_by_sql = 't.last_post';
$sql = 'SELECT t.id AS tid, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.id IN('.$search_results.') GROUP BY t.id, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id'.$group_by_sql.' ORDER BY '.$sort_by_sql;
$result = $db->query($sql) or error('Unable to fetch search results', __FILE__, __LINE__, $db->error());
$search_set = array();
while ($row = $db->fetch_assoc($result))
    $search_set[] = $row;
$db->free_result($result);

// Write out feed
echo '<?xml version="1.0" encoding="ISO-8859-1" ?>'."\n";
echo '    <rss version="2.0">'."\n";
echo '        <channel>'."\n";
echo '            <title>'.$title .'</title>'."\n";
echo '            <link>'.$baseURL.'</link>'."\n";
echo '            <description>'.$desc .' '.count($search_set).'</description>'."\n";
echo '            <language>en</language>'."\n";
echo '            <copyright>© '.$title .'</copyright>'."\n";
echo '            <lastBuildDate>'.date("r").'</lastBuildDate>'."\n";
//loop through items
for ($i = 0; $i < count($search_set); ++$i) {
echo '            <item>'."\n"; 
echo '            <title> '.$search_set[$i]['subject'].' </title> '."\n";
                if ($search_set[$i]['question'] == "")
echo '            <link>'.$baseURL.'/viewtopic.php?id='.$search_set[$i]['tid'].'</link>'."\n";
                else
echo '            <link>'.$baseURL.'/viewpoll.php?id='.$search_set[$i]['tid'].'</link>'."\n";
echo '            <description>'.str_replace("\n", '<br />', pun_htmlspecialchars($search_set[$i]['message'])).'</description> '."\n";
echo'            </item>'."\n";
}

// end feed
echo'        </channel>'."\n";
echo'    </rss>';
}
?>

Nice, but it don't show private posts hmm

Smartys wrote:
Tjalve wrote:
Smartys wrote:

/browser is Trac
http://dev.punbb.org/svn/punbb/branches/punbb-1.3-dev/
That's SVN

ah, but anonymous access isn't working, asks for password.

It works fine for me, are you checking out?

Worked fine on linux, but on windows (tortoisesvn) it asks for password... hmmm

pogenwurst wrote:

Google Reader (currently my primary RSS reader) is excellent, and a cinch to set up if you already have an account on Google/Gmail. I believe there are several "notifier" extensions for Firefox.

The beta version of Bloglines (beta.bloglines.com) also seems nice.

Tried google reader but the update rate was too slow and punbb feed didn't update all the time...

I use rssticker for firefox, nice if you only have a few feeds.

http://www.chrisfinke.com/addons/rss-ticker/

Smartys wrote:
Tjalve wrote:

SVN anon checkout broken?

just get:
Error * PROPFIND request failed on '/browser/branches/punbb-1.3-dev' PROPFIND of '/browser/branches/punbb-1.3-dev': 200 Ok (http://dev.punbb.org)

or am I just a nabb?

/browser is Trac
http://dev.punbb.org/svn/punbb/branches/punbb-1.3-dev/
That's SVN

ah, but anonymous access isn't working, asks for password.

SVN anon checkout broken?

just get:
Error * PROPFIND request failed on '/browser/branches/punbb-1.3-dev' PROPFIND of '/browser/branches/punbb-1.3-dev': 200 Ok (http://dev.punbb.org)

or am I just a nabb?

60

(19 replies, posted in General discussion)

http://www.epixplx.com/images/galleries … 0_1050.jpg
http://www.epixplx.com/images/galleries … 0_text.jpg
http://www.epixplx.com/images/galleries … 0_1050.jpg

quick 15min job. Just resized the punbb logo and blurred it too hide the nasty edges tongue, cba making it into vector.

If anyone has the logo and the text in vector please post it smile

ah, stupid me...

UPDATE lala SET column_name = column_name + 13 * 60 * 60;
Only prob is that you have too find and run that on all the timestamps tongue

Thats the only way i know off, hope that helped more than my first post smile

It's not in mysql, punbb use timestamps. Timestamp is a format popularized by the *NIX operating systems that stores the amount of time that has passed since January 1, 1970.

You have too set timezone go to the punbb admin panel -> options -> Server timezone, and change it...

Install notes might be a bit off, since my viewtopic.php is pretty much hacked a part. So i used the default viewtopic.php.

http://www.epixplx.com/images/galleries … .take2.jpg

#
#---------[ 1. OPEN ]---------------------------------------------------------
#
Viewtopic.php

#
#---------[ 2. FIND ]---------------------------------------------
#

            <div class="postleft">
                <dl>
                    <dt><strong><?php echo $username ?></strong></dt>
                    <dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>
                    <dd class="postavatar"><?php echo $user_avatar ?></dd>
<?php if (count($user_info)) echo "\t\t\t\t\t".implode('</dd>'."\n\t\t\t\t\t", $user_info).'</dd>'."\n"; ?>
<?php if (count($user_contacts)) echo "\t\t\t\t\t".'<dd class="usercontacts">'.implode('  ', $user_contacts).'</dd>'."\n"; ?>
                </dl>
            </div>
            <div class="postright">
                <h3><?php if (($post_count + $start_from) > 1) echo ' Re: '; ?><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></h3>

#
#---------[ 3. REPLACE WITH ]------------------------------------------------
#

<!-- VBMOD start -->
    <div class="userinfo">
        <table cellpadding="0" cellspacing="10" border="0" width="100%">
        <tr>
            <td class="userimg"><?php echo $user_avatar ?></td>
            <td nowrap="nowrap">
                <div id="username">
                    <strong><?php echo $username ?></strong>
                </div>
                <div class="user_title"><?php echo $user_title ?></div>
            </td>
            <td width="100%"> </td>
            <td valign="top" nowrap="nowrap">    
                <div class="userinfo">
                    <?php if (count($user_info)) echo "\t\t\t\t\t".implode('</dd>'."\n\t\t\t\t\t", $user_info).'</dd>'."\n"; ?>
                    <?php if (count($user_contacts)) echo "\t\t\t\t\t".'<dd class="usercontacts">'.implode('  ', $user_contacts).'</dd>'."\n"; ?>
                    <?php if ($cur_post['poster_id'] > 1) echo '<p>'.$is_online.'</p>'; ?>
                </div>
            </td>
        </tr>
        </table>
    </div>
<!-- VBMOD stop -->

#
#---------[ 4. OPEN ]---------------------------------------------------------
#

style\imports\base.css

#
#---------[ 5. Add at the end]------------------------------------------------
#

/************************************************
    VB VIEWTOPIC MOD
************************************************/
div.userinfo td {
    
    BORDER-WIDTH: 0px
}

div.postmsg {

    margin: 5px;
}

64

(11 replies, posted in PunBB 1.2 troubleshooting)

You don't need too include any, just choose you default theme in Administration -> Options -> Default style or if only you want too use it go too Profile -> Display -> Select your preferred style.

The forum loads 3 css files for each style, it first loads the Stylename.css (style specific layout) witch again loads Base.css (Basic layout) and stylename_cs.css (The color scheme).

Did that answer it ?

Found some old files...
Tested em put on my test forum
http://www.epixplx.com/images/galleries … /vbmod.jpg

No mod that i know off, I wrote a mod for my forum a year or so ago. But no one liked it, so i removed it tongue .

If you can wait a few days i can probably trow something together again.... No promises tho

after a bit of cluttering I think I fixed it...

in post.php: //stop it from counting deleted posts as replys
find:
           

$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$tid) or error('Unable to fetch post count for topic', __FILE__, __LINE__, $db->error());

replace with:
           

$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' AND deleted=0') or error('Unable to fetch post count for topic', __FILE__, __LINE__, $db->error());

in function.php.. //too stop $second_last_id, $second_poster, $second_posted beeing deleted=1. not 100% sure if this is needed but :x...
find:
   

$result = $db->query('SELECT id, poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id.' ORDER BY id DESC LIMIT 2') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

replace with:
   

$result = $db->query('SELECT id, poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id.' AND deleted=0 ORDER BY id DESC LIMIT 2') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

as you can see at http://forums.epixplx.com/viewforum.php?id=16 it says 34 replays, but it's only 25..
but when you delete the last post on the page it goes down too 23 replays on the viewforum witch is right (first post is 0)

Hope that helps.

hmm think i found a bug :S

create a new thread, fill it with post until you hit page 2.
then delete 2 posts (so you can have 1 more posts on page 1 before the next post goes on page 2) post 1 more post and you will see that it goes too page 2....
http://forums.epixplx.com/viewtopic.php … 179#p39179

you can with php but if you have alot of images the page is gonna be SLOW.

Find:

$img_tag = '<img width="500" class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" /> <br> This image has been resized, click <a href="'.htmlspecialchars($url).'">here</a> to view the full-sized image.';

Replace with one of these:

centered:

$img_tag = '<center><img width="500" class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" /> <br> This image has been resized, click <a href="'.htmlspecialchars($url).'">here</a> to view the full-sized image.</center>';

Lightbox:

$img_tag = '<a href="'.$url.'" rel="lightbox"><img width="500" class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" /></a> <br> This image has been resized, click <a href="'.htmlspecialchars($url).'">here</a> to view the full-sized image.';

Lightbox and Centered:

$img_tag = '<center><a href="'.$url.'" rel="lightbox"><img width="500" class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" /></a> <br> This image has been resized, click <a href="'.htmlspecialchars($url).'">here</a> to view the full-sized image.</center>';

You can change the width by changeing the "width="500"" too something else ofc.

ah, typo on my part there tongue

find:
$text = preg_replace('#\[imgrs\]((ht|f)tps?://)([^\s<"]*?)\[/imgrs\]#e', 'handle_img_tag_res(\'$1$3\')', $text);

replace with:
$text = preg_replace('#\[imgrs\]((ht|f)tps?://)([^\s<"]*?)\[/imgrs\]#e', 'handle_img_tag_rs(\'$1$3\')', $text);

Sorry about that.

Fatal error: Call to undefined function: handle_img_tag_res() blablabla ?

hmm strange...
ah, remove the

function handle_img_tag_rs($url, $is_signature = false)
{

 blablablalbla

}

from the bottom of the file.

I think you added it in the wrong place the first time.

Find:

    return $img_tag;
}

As you can see, add it after the } and NOT after return $img_tag;

hmm you did something wrong when adding:

function handle_img_tag_rs($url, $is_signature = false)
{
    global $lang_common, $pun_config, $pun_user;

    $img_tag = '<a href="'.$url.'" onclick="window.open(this.href); return false;"><'.$lang_common['Image link'].'></a>';

    if ($is_signature && $pun_user['show_img_sig'] != '0')
        $img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
    else if (!$is_signature && $pun_user['show_img'] != '0')
        $img_tag = '<img width="500" class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" /> <br> This image has been resized, click <a href="'.htmlspecialchars($url).'">here</a> to view the full-sized image.';
    return $img_tag;
}

try and remove it  and add it at the bottom of the file.