Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 94 lines (52 sloc) 4.388 kb

LoU-PHP Mailing List Generator

Version 0.0.1

Description

A complete out-of-the-box script based on the LoU-PHP class that will generate continent specific mailing lists for multiple alliances and post those lists automagically to their respective continent threads in the alliance forum. Can also generate a text file listing every continent with members residing on them along with the amounts of members for each continent.

Requirements

This class requires a valid and authenticated LoU session using the LoU-PHP class. The Forum Manager class which is also based on LoU-PHP is also required.

Installation

It is highly advised that you clone this repository with the --recursive flag. That will not only download this class, but will also download all dependancies into their proper places.


~$ git clone --recursive https://github.com/PastorBones/LoU-PHP-Mail-List-Generator

Usage

Begin by configuring the Mail List Generator by editing the config.ini file. You'll have to enter your LoU credentials, alliance name, and a few other options before it will work.

Once your configuration is setup, simply open a terminal (command prompt) and start the script by running the app.php file

~/Mail-List-Generator>php app.php

Configuration Details

I have tried to build in as many configuration options as possible. This allows you to customize the output of this script to meet your individual taste. The default configuration file is well documented and doesn't need much explanation, but I would like to explain the template file. A default template file has been provided for you and is named maillist.tpl.

The template file allows you to write your own post and include the data generated by the script wherever you want. This works by using template variable marked with {{ variable }} as shown in the example below.


This mailing list has been automatically generated and posted for your convenience. If it becomes
incorrect or outdated, please mail me immediately and I will re-generate the lists. [b]Always check
for outdated lists before sending sensitive information![/b]

[b][u]Last Update[/u]:[/b] {{ DATE }}

[u]Alliance Leaders[/u]
    {{ leaders }}

[u]Alliance Officers[/u]
    {{ officers }}

[u]Continent Leaders[/u]
    {{ cont-leaders }}

{{ LOOP: alliance }}
[u][{{ name }}][/u]
    {{ list }}
{{ ENDLOOP }}

As you can see this leaves alot of room for customization of the actual post sent to the forum. Here is a list of variables and their meanings

  • {{ DATE }} - The current date as formatted in the configuration options.

  • {{ leaders } - The list of alliance leaders exactly as written in the configuration file.

  • {{ officers }} - The list of of officers exactly as written in the configuration file.

  • {{ cont-leaders }} - The list of continent leaders written in the config file that matches the continent forum for which we're posting in.

  • {{ LOOP: alliance }} / {{ ENDLOOP }} - Specifies the subsection that is replaced by each alliance for this continent.

  • {{ name }} - The alliance name for the list we're on in the current loop.

  • {{ list }} - The actual mailing list for the current alliance and continent.

Could there be more?

Why yes, there can and there will be! This is only one simple application of the LoU-PHP class. I'll be making more of them as the ideas come along, but feel free to make your own script and have it listed on the LoU-PHP Wiki!

License

Copyright 2012, Roger Mayfield

Licensed under the MIT License (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://opensource.org/licenses/mit-license.php

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Something went wrong with that request. Please try again.