151

(13 replies, posted in PunBB 1.2 troubleshooting)

if you're using miniportal, wait for Connorhd's answer.

Ludo,

152

(13 replies, posted in PunBB 1.2 troubleshooting)

You can try something like that:

<?php
include 'http://www.yoursite.com/forum/plugins/A … /news.html';
?>

Ludo,

153

(14 replies, posted in PunBB 1.2 troubleshooting)

you must create your own index.php with this code:

<?php

define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';

$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';

function pun_news($fid='', $show=15, $truncate=1)
{
    global $lang_common, $db, $pun_config, $db_prefix;
    $max_subject_length = 30;
    $show_max_topics = 50;
    $fid = intval($fid);
    $order_by = 't.posted';
    $forum_sql = '';
    // Was a forum ID supplied?
    if ( $fid ) $forum_sql = 'f.id='.$fid.' AND ';
    $show = intval($show);
    if ($show < 1 || $show > $show_max_topics)
    $show = 15;
    $saveddate="";
    // Fetch $show topics
    $result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, f.id AS fid, f.forum_name FROM '.$db_prefix.'topics AS t INNER JOIN '.$db_prefix.'forums AS f ON t.forum_id=f.id WHERE f.id='.$fid.' AND t.moved_to IS NULL ORDER BY '.$order_by.' DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
    $show_count = 0;
    if ( !$db->num_rows($result) ) return $output;
    while ( ($show_count < $show) && ($cur_topic = $db->fetch_assoc($result)) ) {
        $temp = '';
        if ($pun_config['o_censoring'] == '1')
            $cur_topic['subject'] = censor_words($cur_topic['subject']);
        if (pun_strlen($cur_topic['subject']) > $max_subject_length)
            $subject_truncated = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).' ...';
        else
            $subject_truncated = $cur_topic['subject'];
        $newsheading = '<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.pun_htmlspecialchars($subject_truncated).'</a> - <em>Posted by '.$cur_topic['poster'].' at '.date('h:i A', $cur_topic['posted']).'</em><br>';
        // Group posts by date   
        $thisdate = date('l, d F Y', $cur_topic['posted']);
        if ($thisdate != $saveddate)
        {
            if ($saveddate)
            {
                $temp .= "</div></div>";
            }
            $temp .= '<div class="block"><h2><span>'.$thisdate.'</span></h2><div class="box"><div class="inbox"><p>';
            $saveddate = $thisdate;
        }
        else {
            $temp .= '<div class="inbox"><p>';
        }
        $temp .= $newsheading.'</p><p>';
        $id = $cur_topic['id'];
        $msg = $db->query('SELECT id, poster, poster_id, poster_ip, poster_email, message, posted, edited, edited_by FROM '.$db_prefix.'posts WHERE topic_id='.$id.' LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
            if ( !$db->num_rows($msg) ) continue;
        $cur_post = $db->fetch_assoc($msg);
        // Display first paragraph only (comment out next four lines to turn off)
        if ($truncate == 1)
        {
        $paragraph = preg_split("/\s*\n+/", $cur_post['message']);
            if (isset($paragraph[1])) {
                $cur_post['message'] = $paragraph[0] . "...";
            }
        }
        $cur_post['message'] = parse_message($cur_post['message'], 0);
        $temp .= $cur_post['message'];
        $temp .= "</p></div>";
        if (isset($output)) {
            $output .= $temp;
        }
        else {
            $output = $temp;
        }
        ++$show_count;
    } // end of while
    $output .= "</div></div>";
    return $output;
}
?>
        <div class="block">
            <h2><span>Welcome</span></h2>
            <div class="box">
                <div class="inbox">
                    <p>
                    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent augue. Nulla facilisi. Fusce bibendum accumsan erat. Quisque sollicitudin mattis neque. Sed dapibus. Integer a lectus eu sem consequat pellentesque. Morbi rhoncus nulla. Duis adipiscing interdum velit. Fusce ante. Ut vitae enim sit amet magna sodales hendrerit. In sed tortor at sapien convallis eleifend. Proin mauris. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut metus. Cras ac arcu et arcu porttitor blandit. Nam vitae lectus eget mauris sollicitudin placerat. Suspendisse vestibulum. Donec varius libero. Duis velit tellus, euismod vitae, consequat sed, consectetuer ut, purus.
                    </p>
                    <p>
                    Praesent viverra venenatis magna. Etiam in dolor. Ut in justo ac nibh malesuada cursus. Duis urna arcu, aliquam vitae, consequat nec, tincidunt non, mi. Nunc lobortis. Nunc pharetra. Sed porttitor. Maecenas turpis tortor, blandit nec, dignissim in, porttitor eu, odio. In hac habitasse platea dictumst. Suspendisse augue odio, ornare a, elementum ac, tincidunt varius, orci. Nulla libero ante, hendrerit ac, consectetuer eu, sollicitudin et, eros. Duis sapien. Suspendisse ornare enim sit amet dui. Donec ullamcorper diam.
                    </p>
                </div>
            </div>
        </div>
<?php
echo pun_news(1, 5, 0);

require PUN_ROOT.'footer.php';


Ludo,

pluriservices is based on punbb. I modified the miniportal with the help of Connorhd in order to have 3 col.
It took some time but it's not really hard. I'm also just using newsgenerator plugin.
The front page of pluriservices is totally independant and I did not have to mod punbb. I did not modify punbb at all (except parser.php for floating images with code xp's help). So, I won't have any problem each time I'll update punbb. That was what I wanted. I did not want to have to update manually, what people who have a punbb modified have to do.

Ludo,

for example, on your site, you only have one forum which has id=2
Si if you want the newsgenerator to work, you must change AP_News_Generator.php

you have
// The forum from which we'll pull the news bits
$forum_id = 11;

you must put
// The forum from which we'll pull the news bits
$forum_id = 2;

and it will work.

To have the post generated on your front page you must put something like that in the code of your front page:

<?php
include('/forum/plugins/AP_News_Generator/news.html');
?>

The main page of punbb is not released. The miniportal is something different.

Ludo,

it's certainly because you have no message in the forum with id=21

have you got a link of your website?

Moreover, I suggest you have a look at miniportal made by Connorhd

Ludo,

157

(5 replies, posted in PunBB 1.2 discussion)

without having to modify code, you can go in admin/options/features/user ranks (put no)
but it affects the whole forum

Ludo,

You were right. It seems to work good now except this:

When you clic on 2005-04 you don't get messages archived on april. You get those which were archived on march.
In fact if we want march, we must ask april.

In spite of this small problem, I thank you for your help wink

Ludo,

Translation:

This is a post status indicator which aims at showing if the problem exposed in the topic is solved or not. The topic creator got a link with 'mark this topic as solved' which changes the colour of the post status indicator. After having marked a topic as solved it's also possible to clic on 'mark topic as unsolved' in order to inform that finally the problem is not solved. This functions are accessible to admin and moderators. You have the possibility to choose on which forum this mod is applied.

Modify news.tpl, put only this code in:

<div class="block"><h2><span><news_subject></span></h2>
<div class="box"><div class="inbox"><p><news_message></p>
        <p class="postedby">Posté par <news_poster>, le <news_posted> | <news_comments></p>
</div>
</div>
</div>

Ludo,

161

(4 replies, posted in PunBB 1.2 troubleshooting)

siervo wrote:

Merci

Mais de rien très cher(e)

Ludo,

162

(4 replies, posted in PunBB 1.2 troubleshooting)

http://punbb.org/forums/viewtopic.php?i … action=new

Where can I download the attachment plugin? I did not know it existed. I saw a mod which could make that. But I think a plugin would be a more simple solution for me.

Ludo,

Hi,

Does an image uploader exist as a plugin?
If Yes, where is it? If no, is somebody interested in making one?

Ludo,

Now I got the code under. It does not give me any notification. But, when I click on an archive, it does not work. It gives me a 404 error.

<?

if (isset($_GET['date'])) {
$date = $_GET['date'];
$date = strip_tags($date);
$date.= '.html';
}
?>
<!-- -->
<? if (!empty($date) && file_exists('/home/ju37853/forum/plugins/AMP_News_Generator/archive/'.$date)) {
include('/home/ju37853/forum/plugins/AMP_News_Generator/archive/'.$date);
} else {
?>
<div id="newshead"><span class="style3">Select an archive date </span></div>
  <div id="box"><p>
  <?php
if ($handle = opendir('/home/ju37853/forum/plugins/AMP_News_Generator/archive/')) {
   while (false !== ($file = readdir($handle))) {
       if ($file != "." && $file != "..") {
       $file = $newphrase = str_replace(".html", "", $file);
           echo '<a href="archive?date='.$file.'">'.$file.'</a><br />';
       }
   }
   closedir($handle);
}
?> 
  </p>
</div> 
<? } ?>

Ludo,

I've just tried it
It gives me a notification:
"Notice: Undefined index: date in /home/ju37853/archives.php on line 51"
You can see at http://www.pluriservices.net/archives.php

Ludo,

I really thank you.
I'll try this code as soon as I can.

Ludo,

we must be careful with that kind of functin because it's really appreciated by spamers.
They post their spam on the forum and they send to people who are not their friends...

Ludo,

already discussed here http://punbb.org/forums/viewtopic.php?id=4766

Ludo,

really well done.
Could you give the code you're using for the login form on your homepage.

Ludo,

171

(11 replies, posted in General discussion)

The result is now known. No with about 55%
We'll stay with Nice's Treaty which is not really cool.
So, British might not have to vote because Blair told that if Frenchie said no, he would not make a referendum.

Ludo,

172

(9 replies, posted in PunBB 1.2 troubleshooting)

Connorhd wrote:

not at all why do you say that? if you post images that are too big they shrink its the best possible solution

To my mind, when an image is too big, it should put a scrollbar, not shrink. I think it 's logical. That is just my opinion.

Ludo,

173

(9 replies, posted in PunBB 1.2 troubleshooting)

does it mean that punbb is not really compatible 800 X 600 with IE?

Ludo,

174

(9 replies, posted in PunBB 1.2 troubleshooting)

what's shrunk? Shouldn't punbb put a scrollbar in that case?

Ludo,

Hi,

I just noticed that there seem to be a small problem with images posted in a message.
See here for example at 800 X 600 http://www.pluriservices.net/forum/viewtopic.php?id=398
Images are cut.

Any idea of what is happening?

Ludo,