1
marcionline
CBB Icon question

How I get the link and the image icon from the firt post in topics?

For what? It's because I want to show the first post's icon from topics instead the last post's icon (image below).

Resized Image

I saw in the file modules/newbb/class/forum.php this lines

$last_post_icon 'XOOPS_URL '/modules/' $xoopsModule->dirname() . '/viewtopic.php?post_id=' $forum_data['forum_last_post_id'] . '&topic_id=' $forum_data['topic_id'] . '#forumpost' $forum_data['forum_last_post_id'] . '">';
//if ($forum_data['icon']) {
//if (!empty($forum_data['icon']) && is_file(XOOPS_ROOT_PATH . '/images/subject/' . $forum_data['icon'])) {
if (!empty($forum_data['icon']) ) {
$last_post_icon .= 'XOOPS_URL '/images/subject/' htmlspecialchars($forum_data['icon']) . '" alt="" />';
} else {
$last_post_icon .= 'XOOPS_URL '/images/subject/icon1.gif" alt="" />';
}
$last_post_icon .= '';
$disp_array['forum_lastpost_icon'] = $last_post_icon;


but I don't know what function I could use to modify those lines... Any tip?

Thanks in advance

2
marcionline
Re: CBB Icon question

Bump!

3
Anonymous
Re: CBB Icon question
  • 2007/6/9 16:38

  • Anonymous

  • Posts: 0

  • Since:


Hi,

I don't know the answer at the moment, but I'm going to trawl through my own CBB files to see if I can help.

Try a PM to phppp? I think he wrote CBB and I'm sure he's not doing much at the moment

4
BlueStocking
Re: CBB Icon question

per your screenshot...
I would use the order of accending instead of "ordem descendente" to show the posts first to last. The resulting code then may give you a idea of how to make the call to the first post icon. Looking at the html code in FrontPage.
________________
or...
modules/newbb/class/forum.php << reading the function display code ....
Brings to mind the last_post_id is the same as the first_post_id if you know how to call only the first entry of the array then don't "continue".

That is a tip, I would give you the exact code if I knew it but I don't. Maybe someone will pick up on it from here or you might be able to adjust it yourself.

Good Luck
BlueStocking
BTW: @John V., Somehow, I think phppp is going to be pretty busy about now. {{grin}}
hhttps://xoops.org/modules/repository .. It is time to get involved - XOOPS.ORG

5
Anonymous
Re: CBB Icon question
  • 2007/6/9 18:05

  • Anonymous

  • Posts: 0

  • Since:


I've had a look and, whilst I may be wrong, I don't think what you want is easily achieved.

At least, I don't think that I (personally) can help

Hope that someone else can.

6
marcionline
Re: CBB Icon question

Ok. My question was solved in XOOPS TOTAL, XOOPS Brasilian community support.

http://www.xoops.net.br/modules/newbb/viewtopic.php?topic_id=8043&post_id=45924#forumpost45924

Here is the code:

In the file modules/newbb/class/forum.php find the function getAllTopics.

Inside it, find this lines:
// topic_icon: priority: sticky -> digest -> regular
            
if ($myrow['icon'] && is_file(XOOPS_ROOT_PATH '/images/subject/' $myrow['icon'])) {
                
$topic_icon 'XOOPS_URL '/images/subject/' $myrow['icon'] . '" alt="" />';
                
$stick 1;
            } else {
                
$topic_icon 'XOOPS_URL '/images/icons/no_posticon.gif" alt="" />';
                
$stick 1;
            }


and change them by these:
$sql1 'SELECT * FROM '.$this->db->prefix('bb_posts').' WHERE topic_id='.$myrow['topic_id'].' ORDER BY pid ASC LIMIT 1';
            
$res $this->db->query($sql1);
            
$row $this->db->fetchArray($res);
            if (
$row['icon'] && is_file(XOOPS_ROOT_PATH '/images/subject/' $row['icon'])) {
                
$topic_icon 'XOOPS_URL '/images/subject/' $row['icon'] . '" alt="" />';
                
$stick 1;
            } else {
                
$topic_icon 'XOOPS_URL '/images/icons/no_posticon.gif" alt="" />';
                
$stick 1;
            }


Cheers!

Login

Who's Online

316 user(s) are online (267 user(s) are browsing Support Forums)


Members: 0


Guests: 316


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits