Topic: A couple of integration questions =)

Hi there, smile

We're bumping into some integration problems. We tried everything we could, but no luck.

1)
We used the following inlog-script:

<?
define('PUN_ROOT', './forum/');
require PUN_ROOT.'include/common.php';

if($pun_user['is_guest'] == "TRUE")
    {
    echo "<form id=\"login\" name=\"login\" name=\"qpost\" method=\"post\" action=\"forum/login.php?action=in\"  onsubmit=\"return process_form(this)\">
                <p>
                    <input type=\"hidden\" name=\"form_sent\" value=\"1\" />
                    <input type=\"hidden\" name=\"redirect_url\" value=\"index.php\" />
                    Gebruikersnaam:<br />
                    <input type=\"text\" name=\"req_username\" size=\"16\" maxlength=\"25\" /><br /><br />
                    Wachtwoord:<br />
                    <input type=\"password\" name=\"req_password\" size=\"16\" maxlength=\"16\" wrap=\"virtual\"><br /><br />
                   <input type=\"submit\" name=\"login\" value=\"Login\" /><br /><br />
                    <a href=\"forum/register.php\">Registreer</a>
                </p>
</form>";
    }
else
    {
    echo "Welkom, <b>".pun_htmlspecialchars($pun_user['username'])."</b><br><a href=\"/web/forum/profile.php?id=".pun_htmlspecialchars($pun_user['id'])."\">Mijn profiel</a><br><a href=\"/web/forum/message_list.php\">Berichten</a>";
    }
?>

This worked normally, but together with certain scripts of Cutenews.RU we get an error. The Cutenews.RU scripts work fine without the above code. This is the error:

Fatal error: Cannot redeclare get_title() (previously declared in XXX/cms/plugins/latest_comments.php:103) in XXX/forum/include/functions.php on line 536

2)
How can I dynamically include the 10 latest posts on the PunBB forum (just the title of the thread it has been posted in)? Is this similar to this:

forum/extern.php?action=active&show=10

and if so, can I just include that with a PHP-include (with the entire http:// of course.)?


3)
I use the Private Message Mod. I can create a link to the Inbox, but I'm not sure how I can show the number of new messages in this link. And if that's not possible, I'd like like to show a message outside the forum that there ARE new messages (like the PunBB forum does).


Sorry for all these subjects (I didn't want to create 3 different threads). If you can help with just one it would be great, too!

Many thanks,

~

Re: A couple of integration questions =)

1. Seems like to peaces of code are creating functions with the same pretty name get_title().
You have to rename this function in one of your two scripts.
You can just do a complete "replace all" operation like get_title() => get_title_cutenews(). But be attentive not to touch get_title() calls of the other script.

2.

How can I dynamically include the 10 latest posts on the PunBB forum

This is easy if you are familiar to SQL.

can I just include that with a PHP-include

Seems like you are not familiar ))

Anyway, for 1.3 take a look at this code:

Same for 1.2 is here and below: http://punbb.informer.com/trac/browser/ … m.php#L109

3. This is one SQL-query too. You can take a look at "Private Message Mod" tables and construct your query the same way as it is done above.

Carpe diem