Hey Guys,

I know someone out there can help me on this. :-)

Just need to find out how to put the echo on this mainly.

thanks
Daryl

2

(21 replies, posted in PunBB 1.2 troubleshooting)

k,

PHP is the program language  that tells your browser what to do.

the mysql is the database that  stores all the posts (information ) from the punbb forum.

now it takes PHP to tell your browser to read the mysql database.

So in other words

you have to know enough about PHP the program language that punbb is written in, inorder to make the  changes in the script to look up and find your mysql database. I think thats all in the config.php

Then you need to create a database so punbb can write to it and keep all your posts so people can see them when the forum scripts calls them.


I hope this helps, Im still learning PHP myself. so this might not be a really good concept of PHP and Mysql

Daryl

ok, :-)

After studying this section of code for awhile i have figured out how you made them link to the form topic. :-)

I understand to add the fields in the string:

$result = $db->query('SELECT t.id, t.subject,  FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON t.forum_id=f.id WHERE t.moved_to IS NULL AND '.$forum_sql.'f.admmod_only=0 ORDER BY '.$order_by.' DESC LIMIT '.$show)


I would add this as such:

$result = $db->query('SELECT t.id, t.subject, <b>((Somthing)))</b> FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON t.forum_id=f.id WHERE t.moved_to IS NULL AND '.$forum_sql.'f.admmod_only=0 ORDER BY '.$order_by.' DESC LIMIT '.$show)

From the looks of this, it looks like that there had been a joining of tables.

ok the only real problem I have is the echo thing.

In the script I do not see any echo for the ' t.id, t.subject ' ?

Im very sorry for all the questions guys, I am tring to learn PHP so i want have to ask so many :-)


Could someone please use this script and put an example in it how to add a different field? Then i can build on that information .

// Fetch $show topics
        $result = $db->query('SELECT t.id, t.subject,  FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON t.forum_id=f.id WHERE t.moved_to IS NULL AND '.$forum_sql.'f.admmod_only=0 ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

        while ($cur_topic = $db->fetch_assoc($result))
        {
            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'];

            echo '<b>·</b> <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><br>'."\n";
        }
    }

    exit;




Thanks so much
Daryl

Ok Thanks Rickard,

I was looking at the code, If im not mistaken i would have to work on this in  this area?

// Fetch $show topics
        $result = $db->query('SELECT t.id, t.subject,  FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON t.forum_id=f.id WHERE t.moved_to IS NULL AND '.$forum_sql.'f.admmod_only=0 ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

        while ($cur_topic = $db->fetch_assoc($result))
        {
            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'];

            echo '<b>·</b> <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><br>'."\n";
        }
    }

    exit;
}


If one of you experts out there could point me in the right direction that would be awsome.

Thanks So much
Daryl

5

(21 replies, posted in PunBB 1.2 troubleshooting)

Hi rscheats,

In order to intall the forum you will need to have some knowledge of php, and mysql.

The first thing i would do is ask your web hosting company if they had mysql even running on your account.

If you do, then what I would suggest is to read about php and mysql on some webpages or by a book on the topic, that should get you going.

I would recomend PHP and MYSQL for dynamic websites. I used this book. I didnt know anyting about either topic, and after reading only half the book, I am able to ready some PHP and was able to create my tabe in mysql that punbb needs to run.

You can always try and find a forum script  that uses a file to write to instead of a database.

Hope this Helps.
Daryl

hi all.

First great script!

My question is this. I can dispaly the latest topic with extern.php, yet it only shows the topic. How can i show who posted the topic, as well as the date and time posted with the topic?

im using this now:

http://www.theharvestnetwork.net/punbb/ … ion=active

after looking in the extern.php, I see some code that has this info under the stats section?

Im new to php, i can read most codes, but cant write it to well yet :-)

Thanks in Advance
Daryl