roadmap Posted November 7, 2006 Share Posted November 7, 2006 #Set these variables to your database info$dbhost = 'localhost'; $dbuser = '6foobar12'; $dbpass = '6f00b4r12'; $dbname = 'rate'; Can someone show me how to properly set that up? Also, i'm suppose to run a installer but how can I set the db name if it hasn't been created yet? Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted November 7, 2006 Share Posted November 7, 2006 What are you trying to install? You should not post sensitive data in the forums. You are just asking to get hacked if you do. If the script you are installing is telling you to create a database and then enter the info in the configuration file here is what you need to do. In cPanel select MySQL Databases Create a new database giving it a name Next create a user and add it to the database you just created. In the config file for the script you are installing enter the following values. $dbhost = 'localhost'; $dbuser = 'cpanelname_username'; $dbpass = 'password-for-username'; $dbname = 'cpanelname_database-name'; Using what you wrote: $dbhost = 'localhost'; $dbuser = 'cpanelname_6foobar12'; $dbpass = '6f00b4r12'; $dbname = 'cpanelname_rate'; Quote Link to comment Share on other sites More sharing options...
roadmap Posted November 8, 2006 Author Share Posted November 8, 2006 Thanks for the quick response. The values entered are the defaults and will be changed to the correct info. Quote Link to comment Share on other sites More sharing options...
roadmap Posted November 8, 2006 Author Share Posted November 8, 2006 Here is the error: Beginning RateMyStuff database installation Creating a database named 'dyypualk_rate'... WARNING: Could not create a database named 'cpanelname_rate' on host localhost. (perhaps it exists, let me see...) Choosing database 'cpanelname_rate'... Creating 'users' table on database 'cpanelname_rate'... WARNING: Could not create a 'users' table in database cpanelname_rate on host localhost. (perhaps it exists, let me see...) ERROR: 'users' table did not exist but couldn't create it. It's suppose to create the database but won't. I've tried to do it with a db and then tried creating on then running it. Neither seems to work. Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted November 8, 2006 Share Posted November 8, 2006 Do you have a link to this script? Quote Link to comment Share on other sites More sharing options...
roadmap Posted November 8, 2006 Author Share Posted November 8, 2006 Here's one in action: http://www.ratemykitten.com/ Quote Link to comment Share on other sites More sharing options...
TCH-Thomas Posted November 8, 2006 Share Posted November 8, 2006 I am not sure but I think Bruce ment a link to the script authors site. Quote Link to comment Share on other sites More sharing options...
TCH-Andy Posted November 8, 2006 Share Posted November 8, 2006 You need to create the database within cpanel (as Bruce said), rather than via the script, and then set the username / password in the script to allow it to access the database. Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted November 8, 2006 Share Posted November 8, 2006 Instructions for creating the database and config entries can be found in post #2 above. Quote Link to comment Share on other sites More sharing options...
roadmap Posted November 8, 2006 Author Share Posted November 8, 2006 Thanks for your help guys but it just isn't working. I've done everything the 2nd post said. Quote Link to comment Share on other sites More sharing options...
TCH-Andy Posted November 8, 2006 Share Posted November 8, 2006 Have you got a link to the manual, or the info on the script itself? The error you list is in trying to create a database - but it shouldn't be doing that, as you should have already created the database in cpanel. Once you have created the database, the config file should have the database name, username etc - which will give access. I assume you have added the user to the database (as Bruce described) ? Quote Link to comment Share on other sites More sharing options...
roadmap Posted November 8, 2006 Author Share Posted November 8, 2006 ########################################################## RateMyStuff # ######################################################### # # # This script was created by: # # # # PHPLabs Web Development Division. # # http://www.phplabs.com/ # # # # This script and all included modules, lists or # # images, documentation are copyright 2002 # # PHPLabs (http://www.phplabs.com/) unless # # otherwise stated in the script. # # # # Purchasers are granted rights to use this script # # on any site they own. There is no individual site # # license needed per site. # # # # Any copying, distribution, modification with # # intent to distribute as new code will result # # in immediate loss of your rights to use this # # program as well as possible legal action. # # # # This and many other fine scripts are available at # # the above website or by emailing the authors at # # staff@phplabs.com or info@phplabs.com # # # ######################################################### [Overview] RateMyStuff allows you to create your own "Rate My..." site just like the popular sites AmIHotOrNot, RateMyKitten, RateMyPoo, etc. ######################################################### [Features] + Similar to "HotOrNot," "RateMyKitten," etc. + 100% templates, easy to fit your own design + Allows visitors to upload their own pictures + Visitors can vote on existing photos + Users can "HookUp" with each other (anonymous contact system) + Pre-built "Top 5", "Top 10," "Worst 10," and "Newest Pics" scripts and templates + Site visitors can report images they believe are offensive + Admin area allows you to view reported images, delete an image, and generate a list of your users' email addresses + Keeps your traffic captivated, entertained, and glued to your site + A great way to sell tons of banner impressions ######################################################### Installation instructions for RateMyStuff ## UNZIPPING ## Inside the zip you should find the following files : INSTALL.txt - Installation instructions _dbschema.doc - database layout (most users won't need this) admin.php - administrative menu script CHANGES.txt - revision history common.php - functions shared among other scripts config.php - configuration variables getimage.php - image display script for static links hookup.php - anonymous contact system script index.php - index (main) page displaying script installer.php - sets up the database and tables new.php - displays newly uploaded images report.php - lets users report offensive photos top.php - displays top 10 best or worst pics user.php - handles user signup/upload/logins vote.php - handles ratings and votes templates/ - (directory) holds HTML template files images/ - (directory) holds image files Unzip all of the files. Open config.php and set all of the variables as indicated. ## EDITING TEMPLATES ## Next, you'll want to edit the HTML template files contained within the templates directory. The first thing you'll likely notice when you open these templates is that they contain special tokens - in the format %variable% - which will be automatically replaced by the scripts with the corresponding content. For example, place the token %random% anywhere you want a randomly selected image, score, and vote link to appear. If you're not quite sure how this works, compare the default index.html template to the RateMyStuff demo available at http://phplabs.com/demo/ratemystuff. You can see how the tokens in the template file are replaced with content by the script: randomly selected images appear in place of %random%, the user login form appears in place of %loginform%, etc. The tokens you can use are: %random% - displays a random image, score, and voting link %loginform% - displays the login form for existing users %lastrate% - shows info about the last pic the visitor rated %top5% - displays a table containing the top 5 rated pics %imageurl% - is replaced with the value of $imageurl in config.php %header% - displays whatever is inside templates/header.html %footer% - displays whatever is inside templates/footer.html %hookup% - displays the HookUp link if the user allows HookUps Not all templates support all tokens. However, any tokens that appear in each default template are supported by that template. header.html and footer.html can also contain the tokens %random% %lastrate% %imageurl% and %loginform%, even though the default templates do not contain any tokens. IMPORTANT: When editing the template files, be sure to leave all forms as-is, with the same action and method attributes. Some templates, such as random.html, also contain other special tokens like %tag% and %voteurl% - you will need to leave those in place. Initially, we suggest simply changing the colors and replacing "RateMyHedgehog" with the name of your own site; then when you're sure your new templates work, you can go on to edit them more in depth. It's a good idea to make backups before doing any major editing. Also note how links are built within the templates. For example, the signup/upload link calls user.php?func=newuser, the Top 10 Best link calls top.php?sort=best, the Top 10 Worst link calls top.php?sort=worst, etc. You will need to formulate your links the same way. Inside the "templates" directory, you'll also find two text files, called hookup_mail_new.txt and hookup_mail_reply.txt. These two files are templates for the email messages users will receive through the HookUp system. MAKE SURE to leave the three existing tokens inside both of these templates. ## UPLOADING ## Once you have edited your template files, upload the entire RateMyStuff package (all of the scripts, plus the images and templates directories) to your web server. Be sure that the scripts and templates are uploaded in ASCII mode and the images are uploaded in BINARY mode. Then chmod the images directory to 777. This step is important, if you do not chmod 777 the images directory, no one will be able to upload any pictures to the site. Next, RENAME THE ADMIN.PHP FILE TO SOMETHING ELSE. This file allows you to view reports that users have made about offensive images, and lets you delete any image by inputting its tag number. Obviously, if you do not rename admin.php, ANYONE WILL BE ABLE TO DELETE IMAGES from your site! PLEASE rename this file. ## DATABASE CREATION ## Point your browser at installer.php wherever you uploaded the RateMyStuff scripts. The installer will create the database and the tables within it. (If your webhost does not allow you to create MySQL databases through PHP scripts, you will need to open the _dbschema.doc file and manually run the commands inside of that file.) As soon as this is done, you should visit the index page and upload a few pics of your own to seed the site. It's suggested that you upload 10-20 pics, especially if you have several %random% tokens on your pages, otherwise it will be pretty obvious to visitors that your site is new. Important notes about a fresh installation of RateMyStuff: 1. Until you upload some pictures, an "uknown image" placeholder will appear anywhere a picture should be displayed. Until you have at least 10 pictures uploaded, the Top 10, Worst 10, and Newest 10 pages will also be "broken." This will fix itself once you upload some images. 2. The first time you upload a picture, you may receive errors on the user info page. This is normal (because the script is trying to calculate stats about other pictures, which didn't exist). These errors should only show up when the first user (you) is created. ######################################################### [usage] Once you have RateMyStuff installed, usage is straightforward. Just visit the site and encourage others to do the same! You should occasionally point your browser at your renamed copy of admin.php to check up on things. If visitors have reported any images as offensive, they will show up on the admin menu with quick links to delete (if offensive) or ignore the report (if the image is fine). From the admin area, you can also delete any image by inputting its tag ID, ban email addresses from signing up, or ban IP addresses from signing up. ######################################################### [support] You can reach technical support at Support@PHPLabs.com. You can also visit us at http://www.phplabs.com/ for more information regarding this and other scripts. Thanks! Quote Link to comment Share on other sites More sharing options...
TCH-Thomas Posted November 8, 2006 Share Posted November 8, 2006 Not sure this is the case but it sounds like it. If your webhost does not allow you to create MySQL databases through PHP scripts, you will need to open the _dbschema.doc file and manually run the commands inside of that file. Quote Link to comment Share on other sites More sharing options...
roadmap Posted November 8, 2006 Author Share Posted November 8, 2006 I tried that also but it didn't work. This file contains the commands necessary to manually create RateMyStuff's database tables. It is unlikely that you will need these commands; however, if the included installer.php file does not work, or if your webhost does not allow you to create MySQL databases via PHP scripts, you (or your webhost) will need to create the database and its tables manually. Edit the first two commands below, replacing 'yourdesiredname' with the name of the MySQL database you want to use. If your webhost has already created the database for you, delete the 'create database' line. Then, copy all of the commands below and paste them into a MySQL command prompt. -- create database yourdesiredname; use yourdesiredname; create table pictures(id integer not null default 0 auto_increment, textid varchar(32) not null, owner varchar(255), filename varchar(255), url text, adddate integer(10), score float default 5.00, numvotes integer, sumvotes integer, lastvote integer(10), active tinyint(1) default 1, approved tinyint(1) default 0, primary key(id,textid), unique key(id)); create table ratings(id integer default 0 not null auto_increment, textid varchar(255) not null, picnum integer not null, score float not null default 0.00, date integer(10), ip varchar(15), primary key(id), unique key(id)); create table users(id integer default 0 not null auto_increment, username varchar(255) not null, password varchar(255) not null, email varchar(255), bio text, hookup tinyint(1) default 0, created integer(10), lastip varchar(15), active tinyint(1) default 1, primary key(id,username), unique key(id)); create table reports(id integer default 0 not null auto_increment, textid varchar(32) not null, ipaddr varchar(15), date integer(10), handled tinyint(1) default 0, primary key(id), unique key(id)); create table hookups(id integer default 0 not null auto_increment, textid varchar(32) not null, sender varchar(32) not null, recipient varchar(32) not null, date integer(10), message text, ipaddr varchar(15), viewed tinyint(1) default 0, primary key(id), unique key(id)); create table bannedips(id integer default 0 not null auto_increment, ipaddr varchar(15) not null, primary key(id, ipaddr)); create table bannedemails(id integer default 0 not null auto_increment, email varchar(255) not null, primary key(id, email)); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.