PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2008-04-04 01:10:36

sleeve
Member
Registered: 2006-05-25
Posts: 72

PunBB integration into other things

I was wondering.. I have a page on my website where people can request songs directly from me when I am live... after clicking request there is a pop up that asks for a username and dedication in 2 different text boxes.. it then posts that to me and my broadcasting software (the song) and there is a read out page which shows me who posted the song and there dedication message, if they left one...

Is there a way I can link that to the $username to be linked to my forum db so they dont have to post  there name, they just have to be logged in?

The script looks like this.... um...

<?
$requestid = $mainsong['requestid'];
if($requestid>0)
{
$db->open("SELECT name, msg FROM requestlist WHERE (ID = $requestid)",1);
           
if(($info = $db->row()) and (!empty($info['msg'])))
{
?>
<table width="100%" bgcolor="<? echo $lightrow; ?>" border="0" cellspacing="0" cellpadding="5">
<tr bgcolor="<? echo $darkrow; ?>"><td nowrap><b><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF">Dedication</font></b></td></tr>
<tr><td>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF"><small>
<?
$info['msg'] = stripslashes($info['msg']);
echo Text2Html(trim($info['msg'])); ?><br>
</small></font>
<br>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF"><small>Dedicated by <br>&nbsp;&nbsp;&nbsp;<b><? echo stripslashes($info['name']); ?></b></small></font>

</td></tr>
</table>
<br>
<?}
}?>

AND

<table border="0">
    <tr><td nowrap><img src="images/im.gif"
        width="16" height="16" align="absmiddle" border="0">&nbsp; <font size=2><b>Dedications</b></font><br></td></tr>
      <tr>
        <td><p class="bodycopy">Would you like to dedicate your
        request to somebody?</td>
      </tr>
      <tr>
        <td>
       
        <form method="POST" action="req.php">
<? InputHidden("requestid",$song["requestid"],0); ?>        
<? InputHidden("songid",$song["songid"],0); ?>
          <p class="bodycopy"><img src="images/arrow.gif" width="14"
          height="9"> Your name:<br>
          <input type="text" name="rname" size="30"></p>
          <p class="bodycopy"><img src="images/arrow.gif"
          width="14" height="9""> Your message<br>
          <textarea rows="4" name="rmessage" cols="24"></textarea><br>
          <input type="submit" value="Dedicate it!" name="B1"></p>
        </form>
       

    </td>
  </tr>
</table>       


AND...

<?
$data = Array();
$data["msg"] = "$rmessage";
$data["name"] = "$rname";

$db = new DBTable();
$db->connect($samlogin);
$db->update("requestlist",$data,"(ID = $requestid)");

$db->open("SELECT * FROM songlist WHERE (ID = $songid)");
$song = $db->row();
$song["requestid"] = $requestid;
PrepareSong($song);
$dedicated = true;

require("req.success.html");
?>

Offline

 

#2 2008-04-04 01:11:47

sleeve
Member
Registered: 2006-05-25
Posts: 72

Re: PunBB integration into other things

I think the bit that matters is the $rname bit

<?
$data = Array();
$data["msg"] = "$rmessage";
$data["name"] = "$rname";

$db = new DBTable();
$db->connect($samlogin);
$db->update("requestlist",$data,"(ID = $requestid)");

$db->open("SELECT * FROM songlist WHERE (ID = $songid)");
$song = $db->row();
$song["requestid"] = $requestid;
PrepareSong($song);
$dedicated = true;

require("req.success.html");
?><?
$data = Array();
$data["msg"] = "$rmessage";
$data["name"] = "$rname";   <---- If there was a way to change this to linking to the forum logon, and getting rid of the text box and just displaying the forum user name

$db = new DBTable();
$db->connect($samlogin);
$db->update("requestlist",$data,"(ID = $requestid)");

$db->open("SELECT * FROM songlist WHERE (ID = $songid)");
$song = $db->row();
$song["requestid"] = $requestid;
PrepareSong($song);
$dedicated = true;

require("req.success.html");
?>

Offline

 

#3 2008-04-04 02:34:52

sleeve
Member
Registered: 2006-05-25
Posts: 72

Re: PunBB integration into other things

How do i pull the usernames from the DB basically is all i really need to know... I think...

Offline

 

#4 2008-04-05 22:57:20

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: PunBB integration into other things

The username of the currently logged in user?

http://punbb.org/docs/dev.html#integration


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.