Raised This Month: $32 Target: $400
 8% 

Advertisements - MySQL Updated 2/5/09


Post New Thread Reply   
 
Thread Tools Display Modes
Author
strontiumdog
Veteran Member
Join Date: Jan 2007
Location: BC, Canada
Plugin ID:
748
Plugin Version:
1.2.100
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Advertisements plugin allowing ads to be run on multiple servers using a single MySQL database
    Unapprover:
    Reason for Unapproving:
    Unapproval requested by author. Author recommends switch to the following plugin as this one has no longer been supported for a while, http://forums.alliedmods.net/showthread.php?t=150731
    Old 02-01-2009 , 18:48   Advertisements - MySQL Updated 2/5/09
    Reply With Quote #1

    Introduction
    This is a wrapper for Tsunami's Advertisements plugin.
    It is essentially additional code that queries a database at the beginning of every map, and then runs the ads, as per Tsunami's plugin.
    Included is a Web interface, allowing Admins to create their ads in a single place, but having them received by all the servers.

    If you have a single server, then you do not need this plugin, and I suggest you install the original Advertisements plugin.

    A brief history
    I wrote this in December because I was getting so fed up changing ads on all 18 of our our servers. One little mistake and the whole thing had to be fixed. In addition, our admins were asking for the opportunity to add their own ads.
    Of all the Advertisements plugins out there, Tsunami's was easily the best and so rather than reinventing the wheel, I adapted his plugin, in true SourceMod fashion.
    I never had any plans to release it, but when many, many people began asking for it, I had to ask Tsunami if it would be OK to release it.
    So a big thanks to him.

    If you have bugs with THIS plugin, then report them here and not in the original Ads plugin.


    Additional Requirements

    Web Server

    MYSQL 5.0+
    PHP 5.0+
    Some knowledge of setting up MySQL databases, phpMyAdmin and installing PHP scripts is required.

    Source Dedicated Server
    MetaMod
    SourceMod 1.1+


    Installation
    Web Interface
    • Create a new SQL database, and make note of the database name, the database username, the database password and the database hostname.
    • Unzip adsmysql from the zipped file onto your desktop and edit:
      • include/config.php
        adding all the database data, any email data and the name of your community
    • Upload all the contents of adsmysql from the zip file to your web server where you want AdsMySQL installed.
    • Using adsmysql.sql, import the MYSQL data into your new database (using phpMyAdmin)
    • Check it is all working by going to http://www.yourdomain.com/adsmysql and log in as Administrator, password Administrator.
      Go to the Admin center and create a new user, then give them level 9 Admin. Usernames and passwords must be longer than six characters. Then delete the Administrator user.
    • Log in as the new Admin and add a couple of advertisements to test run the web interface.
    Game Server
    • Edit your addons/sourcemod/configs/databases.cfg file and add a new section:

      Code:
               "admintools"
          {
              "driver"            "mysql"
              "host"            ""
              "database"            ""
              "user"            ""
              "pass"            ""
              //"timeout"            "0"
              "port"            "3306"
          }
      filling in the information with all the database data.
    • Upload adsmysql.smx to addons/sourcemod/plugins folder
    • Restart the game server and check for any errors in the logs
    CVARS
    Change time between ads (default 45 seconds)

    sm_adsmysql_interval "30"

    Web Interface

    The web interface has nine levels of admin. Level 9 admins have full access. Level 3 can add and edit database entries but cannot delete them.

    You can change the sequence of ads up and down by using the arrow buttons on the right.

    The banner is located in the adsmysql/images and is called logo02.jpg. It is an 800x100 image.

    Site in use: http://www.theville.org/admintools/ads.php


    Game Server Interface
    Ads only get reloaded from the database at the beginning of each map.
    Admins get a menu command under Server Commands which will allow them to manually reload the ads in the middle of a game.
    • sm_reloadads - Reloads the ads from within the game

    Writing Ads

    The Interface is simple to use:



    Advert Type: Only Hint text, Says and Csays are supported in this current version.
    Say text supports the following colors:
    {DEFAULT}, {TEAM}, {GREEN} and {LIGHTGREEN}
    For a full explanation on how to type in all tags, check out Tsunami's original plugin notes, under Text: http://forums.alliedmods.net/showthread.php?t=67885

    Ad Visibility: For simplicity, there are three levels:
    • Admins only
    • Not visible by Admins
    • All players
    Admins are defined as those with Reserved Slot status.

    Game Type: Ads can be sent to all servers, or only certain servers running that particular game.
    Currently supported
    • CSS
    • DoDS
    • TF2
    • Insurgency
    • Pirates, Knights and Vikings.
    If you need other games added to the interface, then ask for them in this thread.

    Notes

    This has been thoroughly tested over the past few months on TF2, DoDS, CSS, Zombie Panic Source, Age of Chivalry, Pirates, Vikings and Knights 2 and Insurgency.

    Tsays have been omitted from this version. We never use them in our community because they are short, and easily missed. If there is sufficient interest, I will add them back in.

    Has been installed by other communities (as test run guinea pigs!) without issues.

    Bear with me on this one! I had to rip it out of an 'Admin Center' plugin that I have written, that incorporates:
    • CommsTools - Permanent Muting/Gagging/Silencing across servers
    • Advertisements via MySQL - this plugin
    • Admin Tracker - tracks all your admins and the amount of time they spend on servers
    It makes it easier to install and manage.


    Credits
    Thanks to Tsunami for allowing me to adapt a good chunk of his code in this plugin.

    Thanks also to msleeper and mauirixxx for helping me test the install.

    Changelog
    Server Plugin
    v1.2.100
    Released to community

    Web Server Interface
    v1.3
    Released

    v1.4
    + Added top say
    + Automatically adds a space after a brace to ensure tsay works
    + Added Age of Chivalry, HL2DM, ZPS
    + Fixed minor security bug
    + Added definition so Server Ops can choose what to call Admins (include/config.php)
    + Added Left4Dead to 'edit ads' page
    + Fixed up HTML layout
    + Fixed bug where ads could not be added due to duplicate ids
    + Added ID column to help in sequencing
    + Changed icon for All games

    v1.5
    + Fixed sequence arrows in IE
    + Fixed for some PHP interpreters where <? can't be used for PHP scripts.
    Attached Files
    File Type: zip adsmysql.zip (171.9 KB, 4593 views)
    File Type: sp Get Plugin or Get Source (sm_adsmysql.sp - 5022 views - 15.8 KB)
    __________________
    Plugins | TheVille
    Zombie Mod for DoD:S - l4dod.theville.org

    Last edited by strontiumdog; 04-10-2009 at 12:10.
    strontiumdog is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 02-01-2009 , 21:44   Re: Advertisements - MySQL - v1.2.100
    Reply With Quote #2

    Do we need to still have tsunamis plugin on or just this? Does it support L4D? Can I add this to a database that has SB installed already?
    __________________

    DontWannaName is offline
    strontiumdog
    Veteran Member
    Join Date: Jan 2007
    Location: BC, Canada
    Old 02-01-2009 , 22:36   Re: Advertisements - MySQL - v1.2.100
    Reply With Quote #3

    Just this plugin is needed.

    Single Server = Tsunami's plugin
    Multiple Servers = run this one.

    This is a complicated install for many people, and many game servers do not have access to a web server so it might be a daunting install for many new server admins.

    Testing with L4D....

    The database is your call. It can be added to any existing database, provided the table names are not the same.
    __________________
    Plugins | TheVille
    Zombie Mod for DoD:S - l4dod.theville.org

    Last edited by strontiumdog; 06-26-2009 at 17:58.
    strontiumdog is offline
    Icettiflow
    Senior Member
    Join Date: Jan 2009
    Old 02-01-2009 , 22:42   Re: Advertisements - MySQL - v1.2.100
    Reply With Quote #4

    Another great release. Thanks SD.
    Icettiflow is offline
    msleeper
    Veteran Member
    Join Date: May 2008
    Location: Atlanta, Jawjuh
    Old 02-02-2009 , 00:45   Re: Advertisements - MySQL - v1.2.100
    Reply With Quote #5

    Excellent release, a MUST HAVE for multiple server owners who run advertisements!
    __________________
    msleeper is offline
    Mosalar
    Senior Member
    Join Date: Jul 2004
    Location: Tampa Fl
    Old 02-02-2009 , 01:03   Re: Advertisements - MySQL - v1.2.100
    Reply With Quote #6

    Again, thank you for everything you have brought to the sm community.

    It is not allowing me any more than 4 ads. Did I goof somewhere?

    Last edited by Mosalar; 02-02-2009 at 01:28.
    Mosalar is offline
    strontiumdog
    Veteran Member
    Join Date: Jan 2007
    Location: BC, Canada
    Old 02-02-2009 , 01:49   Re: Advertisements - MySQL - v1.2.100
    Reply With Quote #7

    What's your URL?
    __________________
    Plugins | TheVille
    Zombie Mod for DoD:S - l4dod.theville.org
    strontiumdog is offline
    Mosalar
    Senior Member
    Join Date: Jul 2004
    Location: Tampa Fl
    Old 02-02-2009 , 01:58   Re: Advertisements - MySQL - v1.2.100
    Reply With Quote #8

    Pm sent your way..

    *EDIT*
    Created another db and I can add plenty of ads, must have mucked the first one up...

    Last edited by Mosalar; 02-02-2009 at 02:44.
    Mosalar is offline
    Sgt-Mess
    Senior Member
    Join Date: Dec 2007
    Location: Sway Side,WA
    Old 02-02-2009 , 03:17   Re: Advertisements - MySQL - v1.2.100
    Reply With Quote #9

    Can you use this to relay only certain messages of advertisements with the MySql to all your servers, and at the same time still use the single server version.

    I only as this because I think it would be a great feature, because some servers might have adverts for things other servers on your database might not need.

    Like things from css, that wouldn't be on for say a team fortress 2 server.
    __________________
    Sgt-Mess is offline
    Send a message via AIM to Sgt-Mess
    ottobohn
    Senior Member
    Join Date: Sep 2007
    Old 02-02-2009 , 09:25   Re: Advertisements - MySQL - v1.2.100
    Reply With Quote #10

    Finally, mysql adverts..gets my nipples hard. Ty for a good plugin and the other thing.

    otto
    __________________
    Director

    Gaming with benefits.
    www.n00bsalad.net
    ottobohn is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 06:28.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode