|
Author |
Message |
frost4thx
Junior WebHelper
Joined: 14 Jun 2003
Posts: 1
|
Posted:
Sat Jun 14, 2003 9:19 pm (21 years, 6 months ago) |
|
first off, lemme say im really sorry lol... i have no idea how to work mysql, and im just getting started with php..
im trying to install a notification mod thingy for phpbb2 so people can be notified whenever a forum has a new topic
the instruction manual said
Code: | #################################################################
##
## Author Note:
##
## This mod adds a "watch this forum" link to the viewforum page, similar to the
## "watch this topic" link on viewtopic. further on, this mod changes the structure
## of email bodies, now including the post text, the name of the poster etc. in the
## email.
## there are different email texts for watched topic (reply), watched forum (newtopic) and
## watched forum (reply).
## the texts are available both in english and german
##
## security should be ok, you are not able to receive a notification email if the forum is private
## and you are not allowed to read!
##
## Do not forget to run the following commands on your sql database (replace phpbb2_ with your db prefix):
##
## CREATE TABLE phpbb2_forums_watch (
## forum_id smallint(5) unsigned NOT NULL default '0',
## user_id mediumint(8) NOT NULL default '0',
## notify_status tinyint(1) NOT NULL default '0',
## KEY forum_id (forum_id),
## KEY user_id (user_id),
## KEY notify_status (notify_status)
## )
##
## ALTER TABLE phpbb2_forums
## ADD forum_notify TINYINT(1) UNSIGNED DEFAULT '1' NOT NULL
## AFTER forum_last_post_id
##
## the description is for subsilver theme users, it should work with every theme
## if you are using the files from the package you only have to run the sql command
##
## this mod was tested on phpBB 2.0.0
##
## Should be no problem for any user who knows what they are doing ;-)
##
################################################################# |
how do i add this? thanks alot in advance... |
|
|
|
|
Riker
Junior WebHelper
Joined: 01 Mar 2003
Posts: 14
Location: AR, USA
|
Posted:
Sat Jun 14, 2003 11:58 pm (21 years, 6 months ago) |
|
do you have phpMyAdmin? if so...go to the database phpBB is in, and click on the SQL tab...a page should load with a box in it where you can enter code...copy Code: | CREATE TABLE phpbb2_forums_watch (
forum_id smallint(5) unsigned NOT NULL default '0',
user_id mediumint(8) NOT NULL default '0',
notify_status tinyint(1) NOT NULL default '0',
KEY forum_id (forum_id),
KEY user_id (user_id),
KEY notify_status (notify_status)
) | and paste it in that box and hit go...
then copy Code: | ALTER TABLE phpbb2_forums
ADD forum_notify TINYINT(1) UNSIGNED DEFAULT '1' NOT NULL
AFTER forum_last_post_id | and paste it into that box...and it go |
|
|
|
|
Kdawg
Senior WebHelper
Joined: 21 Apr 2003
Posts: 153
|
Posted:
Sun Jun 15, 2003 11:54 pm (21 years, 6 months ago) |
|
If you dont have phpMyAdmin, you could just put it in a php file like createtable.php, and put the code
Code: |
<?
$username = "username goes here"
$password = "pasword goes here"
$database = "database name goes here"
$db = mysql_connect("localhost","$username","$password");
mysql_select_db("$database",$db);
mysql_query("CREATE TABLE phpbb2_forums_watch ( forum_id smallint(5) unsigned NOT NULL default '0', user_id mediumint(8) NOT NULL default '0', notify_status tinyint(1) NOT NULL default '0', KEY forum_id (forum_id), KEY user_id (user_id), KEY notify_status (notify_status)");
mysql_query("ALTER TABLE phpbb2_forums ADD forum_notify TINYINT(1) UNSIGNED DEFAULT '1' NOT NULL AFTER forum_last_post_id");
?>
|
in it. Then run it by calling it in your browser, you would go to www.yoursite.com/createtable.php. |
Last edited by Kdawg on Mon Jun 16, 2003 5:09 pm, edited 2 times in total |
|
|
|
drathbun
WebHelper
Joined: 01 Mar 2003
Posts: 69
Location: Texas
|
Posted:
Mon Jun 16, 2003 6:58 am (21 years, 6 months ago) |
|
Putting the code into a php file will work, yes, but you have to add the commands to connect to your database as well. Otherwise it won't know where to put the database tables.
Also, you should check your prefix that you used when installing the software. You can find it in your config.php file, in case you don't remember what it is. Use that prefix instead of 'phpBB2' if you have changed it to something else.
Dave |
________________________________ Dave
Photography Site :: Query Tools Forum :: Weekend Fun |
|
|
|
Kdawg
Senior WebHelper
Joined: 21 Apr 2003
Posts: 153
|
Posted:
Mon Jun 16, 2003 2:27 pm (21 years, 6 months ago) |
|
I did forgot the connect, but I added it so all you have to do is put in you info in where it says and it should work. |
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Mon Jun 16, 2003 2:39 pm (21 years, 6 months ago) |
|
Don't you still need to run the queries? something like this???
Code: | mysql_query("CREATE TABLE phpbb2_forums_watch (forum_id smallint(5) unsigned NOT NULL default '0', user_id mediumint(8) NOT NULL default '0', notify_status tinyint(1) NOT NULL default '0', KEY forum_id (forum_id), KEY user_id (user_id), KEY notify_status (notify_status))") |
|
|
|
|
|
Kdawg
Senior WebHelper
Joined: 21 Apr 2003
Posts: 153
|
Posted:
Mon Jun 16, 2003 5:10 pm (21 years, 6 months ago) |
|
I keep forgeting stuff, I think I got it though. |
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Mon Jun 16, 2003 6:52 pm (21 years, 6 months ago) |
|
Kdawg wrote: | I keep forgeting stuff, I think I got it though. |
Join the club!!
I think 90% of the PHP I write is just copy and pasted from scripts I've written in the past because I can never remember the correct way. |
|
|
|
|
Kdawg
Senior WebHelper
Joined: 21 Apr 2003
Posts: 153
|
Posted:
Mon Jun 16, 2003 10:10 pm (21 years, 6 months ago) |
|
I'm glad im not the only one . |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Jun 17, 2003 7:03 am (21 years, 6 months ago) |
|
Just remember that "practice makes perfect", so keep trying! The more you use a certain function, the easier it'll be to remember it. This helps save valuable time, instead of looking in other scripts you've written, or using the PHP manual. |
________________________________
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.134727 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
|