Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[[GetLastMyBBPosts]] - Etomite snippet
09-03-2005, 11:35 AM (This post was last modified: 09-03-2005 11:38 AM by DennisTT.)
Post: #1
[[GetLastMyBBPosts]] - Etomite snippet
This is a snippet for Etomite to retrieve the last 10 posts from MyBB. It wasn't meant to be a released code so you will have to dig into the code if you wish to modify something (which you will have to do to get it working if your database name is not `dennistt` Toungue)


Attached File(s)
.txt  getlastmybbposts.txt (Size: 10.72 KB / Downloads: 208)

[Image: sig.php]
Visit this user's website Find all posts by this user
Quote this message in a reply
09-03-2005, 06:25 PM (This post was last modified: 09-03-2005 06:26 PM by tsakalos.)
Post: #2
RE: [[GetLastMyBBPosts]] - Etomite snippet
mysql_connect($etomite->dbConfig['host'], $etomite->dbConfig['user'], $etomite->dbConfig['pass']) or die(mysql_error());

is this the place to add the mybb database ? give me an example to see how i can edit it thx
Find all posts by this user
Quote this message in a reply
09-04-2005, 03:22 AM
Post: #3
RE: [[GetLastMyBBPosts]] - Etomite snippet
It's on the line below that,

PHP Code:
mysql_select_db('dennistt'); 
change that to whatever your database name is Wink

[Image: sig.php]
Visit this user's website Find all posts by this user
Quote this message in a reply
09-04-2005, 08:56 AM (This post was last modified: 09-04-2005 09:07 AM by tsakalos.)
Post: #4
RE: [[GetLastMyBBPosts]] - Etomite snippet
i changed the denisstt with mybb database but it didnt work. shall i edit anything more? user pass or anything? should the mubb and etomite be in the same db for it to work ? cause i use 2 different dbs
Find all posts by this user
Quote this message in a reply
09-05-2005, 02:59 AM
Post: #5
RE: [[GetLastMyBBPosts]] - Etomite snippet
Sorry, I forgot to mention that you have to change the table prefix to match yours in every single query.

[Image: sig.php]
Visit this user's website Find all posts by this user
Quote this message in a reply
09-05-2005, 08:00 PM
Post: #6
RE: [[GetLastMyBBPosts]] - Etomite snippet
what do u mean? which table prefix and should mybb db and etomite db be in the same db ?
Find all posts by this user
Quote this message in a reply
09-06-2005, 02:24 AM
Post: #7
RE: [[GetLastMyBBPosts]] - Etomite snippet
tsakalos Wrote:what do u mean? which table prefix
PHP Code:
$result mysql_query("SELECT canview FROM [b][u]mybbforum_[/b][/u]usergroups WHERE gid = 1") or die(mysql_error()); 
You have to search for all those mybbforum_ and change that to whatever your MyBB table prefix is (usually mybb_ )
tsakalos Wrote:and should mybb db and etomite db be in the same db ?
It doesn't matter as long as your settings are correct.

[Image: sig.php]
Visit this user's website Find all posts by this user
Quote this message in a reply
09-06-2005, 03:00 AM
Post: #8
RE: [[GetLastMyBBPosts]] - Etomite snippet
Access denied for user 'greek_etu'@'localhost' to database 'greek_mybb'
Find all posts by this user
Quote this message in a reply
09-06-2005, 04:55 AM
Post: #9
RE: [[GetLastMyBBPosts]] - Etomite snippet
Oh sorry, if you are not using your etomite database, you should change
Code:
mysql_connect($etomite->dbConfig['host'], $etomite->dbConfig['user'], $etomite->dbConfig['pass']) or die(mysql_error());
to
Code:
mysql_connect('localhost', 'yourdbuser', 'yourdbpass') or die(mysql_error());

[Image: sig.php]
Visit this user's website Find all posts by this user
Quote this message in a reply
11-02-2005, 08:43 PM
Post: #10
RE: [[GetLastMyBBPosts]] - Etomite snippet
hey there

ihavent looked yet at the code, but from what i read, i have a question,can't that exceed the number of 10 last posts?? can we make it more.

and what do u mean by last posts , will it show the posts as u see them in view new posts, or show the title of the thread and u see it in the index or any category (such the one they have in msgplus.net "get latest posts"!)

thx in advance
chaw

[Image: signature.jpg]
http://techex.techindo.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: