|
[Tutorial] Basic Site-Forum Integration
|
|
10-31-2006, 01:34 AM
(This post was last modified: 11-04-2006 10:19 PM by lupus2k5.)
Post: #1
|
|||
|
|||
|
[Tutorial] Basic Site-Forum Integration
This tutorial is by me, but the code used is mostly modified from code by other user tutorials, so don't think all the PHP is mine.
Creating a Login Form/Basic Userbox Modify the code and then insert it on your page. My forum is on a separate subdomain, so I have put the login/userbox in a separate file on my subdomain, then put it on my site in an iframe. Insert this code at the very top of your Web page code, before all other PHP or HTML. PHP Code: <?phpPHP Code: <script>PHP Code: <?phpCreating a Recent Posts Box Edit the code accordingly. If you have already added the chdir() because you added the Userbox, do not add it again, nor the $rel line. PHP Code: <?phpForum Statistics None of this code was by me, but I shortened it. Modify it accordingly. Do not include the configuration lines and connection lines (from $host to $sel) lines if you already inserted them earlier in the same file. PHP Code: <?phpThat concludes my tutorial. EDIT (11.04.2006 @ 15:17 GMT-7 by lupus2k5): Fixed basic errors (lack of parenthesi and lack of script end--?>)./EDIT
|
|||
|
10-31-2006, 03:22 AM
Post: #2
|
|||
|
|||
|
RE: [Tutorial] Basic Site-Forum Integration
Why are you opening another MySQL connection? Since you're including the global.php, why not just use the MyBB database class?
[MyBB Templates] [ProgrammingTalk] [Need Smilies? Get Me Smileys!] [My Blog] ForumUniversity's GlobalWarming Awareness2007 project. |
|||
|
10-31-2006, 03:35 AM
Post: #3
|
|||
|
|||
|
RE: [Tutorial] Basic Site-Forum Integration
Okey, not to be that "negative" about this, great that your trying.
![]() I'm unsure why you are using chdir there, as off 1.2 you don't need to. You can use Code: require $rel."global.php";mysql_fetch_array should be $db->fetch_array. or $db->fetch_field($forum_result, 'count'); for example ![]() Hope this helps you
MyBB Addicted. =) My plug-ins list |
|||
|
11-01-2006, 04:55 PM
Post: #4
|
|||
|
|||
|
RE: [Tutorial] Basic Site-Forum Integration
i ask once again, if my site is not on the same host/adress, can i use this code and how? thanks.
MyBB Version: 1.21 Language Pack Translator: Croatian Percenatge Done: |||||||||| 40% |
|||
|
11-02-2006, 12:11 AM
Post: #5
|
|||
|
|||
|
RE: [Tutorial] Basic Site-Forum Integration
Yeah, I had a lot of issues. I also forgot a parenthesi and I didn't use define("IN_MYBB",1).
And, for D-Man, I just included an Iframe.
|
|||
|
11-04-2006, 04:49 PM
Post: #6
|
|||
|
|||
|
RE: [Tutorial] Basic Site-Forum Integration
GREAT! now somebody makes a tutorial on integrating. when i spent a week coding to get my website to integrate with mybb, shahzam.com , if you want any scripts on there to integrate with mybb ask me.
|
|||
|
11-04-2006, 09:02 PM
Post: #7
|
|||
|
|||
|
RE: [Tutorial] Basic Site-Forum Integration
It didn't work for me...
Does having <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> make this a problem? |
|||
|
11-04-2006, 09:05 PM
Post: #8
|
|||
|
|||
|
RE: [Tutorial] Basic Site-Forum Integration
no, put you should put the include on top of that.
|
|||
|
11-04-2006, 09:07 PM
Post: #9
|
|||
|
|||
|
RE: [Tutorial] Basic Site-Forum Integration
Oh, well that's what I did. How about having the stuff on top and having the rest in a different file? Is that a problem? (I'm using SSI)
|
|||
|
11-04-2006, 09:16 PM
Post: #10
|
|||
|
|||
|
RE: [Tutorial] Basic Site-Forum Integration
You need to use the a PHP document, SSI isn't not the same as PHP.
[MyBB Templates] [ProgrammingTalk] [Need Smilies? Get Me Smileys!] [My Blog] ForumUniversity's GlobalWarming Awareness2007 project. |
|||
|
« Next Oldest | Next Newest »
|
Search
Member List
Calendar
Help






