MySQL + PHP - Forums/Website Integration

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Jaggeh
Forum Newbie
Posts: 16
Joined: Sat Jul 05, 2008 12:59 am
Location: Canada
Contact:

MySQL + PHP - Forums/Website Integration

Post by Jaggeh »

Okay well I have been working in php for awhile, but only the basics. So I started working into higher level stuff and all. But today I came accorss an error where it doesn't connect, and messes up everything (with errors). I'll show what I had, what I'm trying to get, and what happens.

Okay well first of all on the forums (is standard), I have the MemberBar.
Image

The code for the above^^ is:

Code: Select all

<if="$this->ipsclass->member['id']">
<div id="userlinks">
    <p class="home"><b>{$this->ipsclass->lang['logged_in_as']} <a href="{$this->ipsclass->base_url}showuser={$this->ipsclass->member['id']}">{$this->ipsclass->member['members_display_name']}</a></b> ( <a href="{$this->ipsclass->base_url}act=Login&CODE=03&k={$this->ipsclass->md5_check}">{$this->ipsclass->lang['log_out']}</a> )</p>
    <p>
<else />
<div id="userlinksguest">
    <p class="pcen"><b>{$this->ipsclass->lang['guest_stuff']}</b> ( <a href="{$this->ipsclass->base_url}act=Login&CODE=00">{$this->ipsclass->lang['log_in']}</a> | <a href="{$this->ipsclass->base_url}act=Reg&CODE=00">{$this->ipsclass->lang['register']}</a> )
</if>
<if="$this->ipsclass->member['mgroup'] == $this->ipsclass->vars['auth_group']">
    <b><a href="{$this->ipsclass->base_url}act=reg&CODE=reval">{$this->ipsclass->lang['resend_val']}</a></b> &middot;
</if>
<if="$this->ipsclass->member['g_access_cp'] == 1 AND $this->ipsclass->vars['security_remove_acp_link'] == 0">
    <b><a href="{$this->ipsclass->vars['_admin_link']}" target="_blank">{$this->ipsclass->lang['admin_cp']}</a></b> &middot;
</if>
<if="$this->ipsclass->member['has_blog'] == 1">
    <b><a href="{$this->ipsclass->base_url}automodule=blog&req=showblog&mid={$this->ipsclass->member['id']}">{$this->ipsclass->lang['myblog']}</a></b> &middot;
</if>
<if="$this->ipsclass->member['has_gallery'] == 1">
    <b><a href="{$this->ipsclass->base_url}autocom=gallery&req=user&user={$this->ipsclass->member['id']}">{$this->ipsclass->lang['submenu_albums']}</a></b> &middot;
</if>
<if="$this->ipsclass->member['id']">
    <b><a href="{$this->ipsclass->base_url}act=UserCP&CODE=00" title="{$this->ipsclass->lang['cp_tool_tip']}">{$this->ipsclass->lang['your_cp']}</a></b> &middot;&nbsp;<a href="{$this->ipsclass->base_url}act=Search&CODE=getnew">{$this->ipsclass->lang['view_new_posts']}</a>
    <if="$this->ipsclass->member['g_view_board']">
        &middot;&nbsp;<a href="javascript&#058;buddy_pop();" title="{$this->ipsclass->lang['bb_tool_tip']}">{$this->ipsclass->lang['l_qb']}</a>
    </if>
    &middot;&nbsp;<a href="javascript&#058;friends_pop();">{$this->ipsclass->lang['gbl_my_friends']}</a>    
</if>
<if="$this->ipsclass->member['g_use_pm'] AND $this->ipsclass->member['members_disable_pm'] == 0">
    &middot;&nbsp;<a href="{$this->ipsclass->base_url}act=Msg&CODE=01">{$msg['TEXT']}</a>
</if>
    </p>
</div>
Now when I set that up on the main site (through the fourms) using:

Code: Select all

<?php include('/../fourms/bar.php'); ?>
My outcome looks like this:
Image

One Question is; is there another way? (Note: The Source must be dynamic because if the user has admin rights, they will be able to see the link to the Admin Panel.)

Second Question is: Can someone fix the current source?
ragnis12
Forum Newbie
Posts: 12
Joined: Tue Jun 17, 2008 4:14 am

Re: MySQL + PHP - Forums/Website Integration

Post by ragnis12 »

are you using smarty template engine?
Jaggeh
Forum Newbie
Posts: 16
Joined: Sat Jul 05, 2008 12:59 am
Location: Canada
Contact:

Re: MySQL + PHP - Forums/Website Integration

Post by Jaggeh »

What's that??

Sounds like something for beginners :? I code all my own stuff....
Jaggeh
Forum Newbie
Posts: 16
Joined: Sat Jul 05, 2008 12:59 am
Location: Canada
Contact:

Re: MySQL + PHP - Forums/Website Integration

Post by Jaggeh »

Still can't get it.
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: MySQL + PHP - Forums/Website Integration

Post by WebbieDave »

Jaggeh
Forum Newbie
Posts: 16
Joined: Sat Jul 05, 2008 12:59 am
Location: Canada
Contact:

Re: MySQL + PHP - Forums/Website Integration

Post by Jaggeh »

WebbieDave wrote:The code you posted is not PHP.
http://www.php.net/manual/en/language.basic-syntax.php
That's why it's all run by PHP?....
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: MySQL + PHP - Forums/Website Integration

Post by Benjamin »

It's PHP. Rather strange but PHP nevertheless.

Anyway, what's your error?
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: MySQL + PHP - Forums/Website Integration

Post by WebbieDave »

astions wrote:It's PHP. Rather strange but PHP nevertheless.
Looks more like Smarty syntax to me.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: MySQL + PHP - Forums/Website Integration

Post by Benjamin »

WebbieDave wrote:
astions wrote:It's PHP. Rather strange but PHP nevertheless.
Looks more like Smarty syntax to me.
Yeah this does not look correct at all. I didn't see that before.

Code: Select all

 
<if="$this->ipsclass->member['g_access_cp'] == 1 AND $this->ipsclass->vars['security_remove_acp_link'] == 0">
    <b><a href="{$this->ipsclass->vars['_admin_link']}" target="_blank">{$this->ipsclass->lang['admin_cp']}</a></b> &middot;
</if>
 
Jaggeh
Forum Newbie
Posts: 16
Joined: Sat Jul 05, 2008 12:59 am
Location: Canada
Contact:

Re: MySQL + PHP - Forums/Website Integration

Post by Jaggeh »

astions wrote:
WebbieDave wrote:
astions wrote:It's PHP. Rather strange but PHP nevertheless.
Looks more like Smarty syntax to me.
Yeah this does not look correct at all. I didn't see that before.

Code: Select all

 
<if="$this->ipsclass->member['g_access_cp'] == 1 AND $this->ipsclass->vars['security_remove_acp_link'] == 0">
    <b><a href="{$this->ipsclass->vars['_admin_link']}" target="_blank">{$this->ipsclass->lang['admin_cp']}</a></b> &middot;
</if>
 
You know of a code to replace all this? :S
Also if you don't know what the above is, if the user has admin privledges, it shows the admin panel.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: MySQL + PHP - Forums/Website Integration

Post by Benjamin »

Code: Select all

 
<if="$this->ipsclass->member['g_access_cp'] == 1 AND $this->ipsclass->vars['security_remove_acp_link'] == 0">
    <b><a href="{$this->ipsclass->vars['_admin_link']}" target="_blank">{$this->ipsclass->lang['admin_cp']}</a></b> &middot;
</if>
 
In pure PHP would be:

Code: Select all

 
<?php if ($this->ipsclass->member['g_access_cp'] == 1 AND $this->ipsclass->vars['security_remove_acp_link'] == 0) { ?>
    <b><a href="<?php echo $this->ipsclass->vars['_admin_link']; ?>" target="_blank"><?php echo $this->ipsclass->lang['admin_cp']; ?></a></b> &middot;
<?php } ?>
 
Jaggeh
Forum Newbie
Posts: 16
Joined: Sat Jul 05, 2008 12:59 am
Location: Canada
Contact:

Re: MySQL + PHP - Forums/Website Integration

Post by Jaggeh »

Refer to Bottom Post.
Last edited by Jaggeh on Fri Jul 11, 2008 9:48 am, edited 1 time in total.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: MySQL + PHP - Forums/Website Integration

Post by onion2k »

It's all based around this ipsclass of yours. We can't help you with that because, while it's PHP code, it's basically a separate app. You'll get much better help using the support forum for IPS (assuming there is one). We can help with specific PHP error messages, but logic errors in a large scale application is a bit beyond the scope of a PHP forum.
Jaggeh
Forum Newbie
Posts: 16
Joined: Sat Jul 05, 2008 12:59 am
Location: Canada
Contact:

Re: MySQL + PHP - Forums/Website Integration

Post by Jaggeh »

Okay now I'll try this code:

Code: Select all

<?php
require_once('ipbwi/ipbsdk_class.inc.php');
$SDK =& new IPBSDK();
if ($_GET['action'] == "logout") {
$SDK->logout();
header('location: '.$_SERVER['PHP_SELF']);
}
?>
 
 
I get an error of:

Code: Select all


Where the memberbar should be.
 
Here's the Code for the file(s) it uses:

Code: Select all

 
<?php
 
$root_path = '*not_shown_for_privacy_reasons*/htdocs/forums';
 
$board_url = 'http://www.gingrichgames.co.cc/forums';
 
$sdklang = 'en';
 
$allow_caching = '1';
 
?>
 

And the other one is:
http://www.gingrichgames.co.cc/uploads/ ... ss.inc.txt
Last edited by Jaggeh on Fri Jul 11, 2008 10:07 am, edited 1 time in total.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: MySQL + PHP - Forums/Website Integration

Post by onion2k »

http://ipbsdk.sourceforge.net/ ... the website for the library itself doesn't work. I don't think I'd hold too much hope for the code in the library doing it's job properly.

:dubious:

However, if you want some support on using it: http://forums.invisionize.com/index.php?showforum=64 ... that's the official support forum. You'll get much better responses there I imagine. They'll know how the code is meant to be working.
Post Reply