All pastes #57690 Raw Edit

Stuff

public text v1 · immutable
#57690 ·published 2006-05-21 18:49 UTC
rendered paste body
<?php
/*********************************************************************************************
 * e107 PLUGIN: Auto Gallery
 * VERSION:     2.xx
 * DESCRIPTION: A very simple media gallery, where galleries are based on a directory
 *              structure. For the e107 CMS (http://e107.org)
 * WRITTEN BY:  Mr_Visible (www.cerebralsynergy.com)
 * DATE:        05/01/2006
 *
 * Released under the terms and conditions of the
 * GNU General Public License (http://gnu.org).
 ********************************************************************************************/

$eplug_name = "Auto Gallery";
$eplug_version = "2.25";
$eplug_author = "mr_visible";
$eplug_url = "http://www.cerebralsynergy.com";
$eplug_email = "mr_visible@cerebralsynergy.com";

require_once (dirname(__FILE__)."/../../class2.php");
$autoGallerySQL = new db;
$autoGallerySQL->db_Select("plugin", "plugin_version", "plugin_name='Auto Gallery' AND plugin_installflag > 0");
list($autoGalVer) = $autoGallerySQL->db_Fetch();
$autoGalVer = preg_replace("/[a-zA-z\s]/", '', $autoGalVer);
 
$eplug_description = "A very simple image gallery, where galleries are based on a directory structure.".($autoGalVer ? "<br /><br />Current Version: $autoGalVer" : '');
$eplug_compatible = "e107v6+";
$eplug_folder = "autogallery";
$eplug_conffile = "admin_main.php";
$eplug_logo = "Images/button.png";
$eplug_caption =  "Configure Auto Gallery";
$eplug_link = TRUE;
$eplug_link_name = "Image Gallery";
$eplug_link_url = e_PLUGIN."autogallery/autogallery.php";
$eplug_readme = "readme.txt"; 
$eplug_icon = $eplug_folder."/Images/icon.png";
$eplug_icon_small = $eplug_folder."/Images/icon_16.png";

$eplug_table_names = array("scores");

$eplug_tables = array(
"CREATE TABLE ".MPREFIX."scores (
scoreid INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
userid INT(10) UNSIGNED NOT NULL,
gamename VARCHAR(100) NOT NULL,
score INT(10) UNSIGNED NOT NULL,
date INT(10) UNSIGNED NOT NULL,
PRIMARY KEY  (scoreid)
) TYPE=MYISAM AUTO_INCREMENT=1;");

$eplug_prefs = array
(
    # 0.1 - 0.2
	"autogal_title" => 'Auto Gallery',
    "autogal_numcols" => 4,
    "autogal_showfooter" => 1,
    "autogal_subgalleryclass" => 'forumheader4',
    "autogal_imagecellclass" => 'forumheader3',
    "autogal_navclass" => 'caption2',
    "autogal_thumbwidth" => 100,
    "autogal_thumbheight" => 100,
    "autogal_keepaspect" => 1,
    "autogal_navseperator" => ' &gt;&gt; ',
    "autogal_rootname" => 'Root',
	# 1.0
	"autogal_revuploaduc" => 253,
    "autogal_uploadmaxsize" => 1000000,
    "autogal_emailtofriend" => 1,
    "autogal_numgallcols" => 2,
    "autogal_defaultetfcom" => "Check this out!",
	# 1.5
	"autogal_maximagewidth" => 800,
	"autogal_maximageheight" => 600,
	"autogal_maxperpage" => 20,
	"autogal_gallerydir" => "",
	# 1.6
	"autogal_showautogalver" => 1,
	"autogal_showadminmenu" => 1,
	"autogal_uploadnumber" => 5,
	# 1.7
	"autogal_chmodwarnoff" => 0,
	# 1.8
	"autogal_adminreviewuc" => 254,
	"autogal_showsubtitlesgal" => 1,
	"autogal_flashwidth" => 550,
	"autogal_flashheight" => 400,
	# 1.83
	"autogal_imkanigif1st" => 1,
	"autogal_defimgwidth" => 150,
	"autogal_defimgheight" => 150,
	# 1.84
	"autogal_shownewest" => 1,
	"autogal_shownewestinroot" => 1,
	# 1.90
	"autogal_showinnewwindow" => 0,
	"autogal_newwindowargs" => 'width=800,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes',
	"autogal_moviewidth" => 550,
	"autogal_movieheight" => 400,
	# 2.0 BETA
	"autogal_autothumb" => 1,
	"autogal_metaon" => 0,
	"autogal_metacomments" => 0,
	"autogal_metaviewhits" => 0,
	"autogal_metaemailhits" => 0,
	"autogal_titleheadstyle" => 1,
	"autogal_showerrorlog" => 1,
	"autogal_generatedebuglog" => 0,
	"autogal_enablesearch" => 1,
	"autogal_searchmaxresults" => 20,
	"autogal_xmlsearch" => 1,
	# 2.1 BETA
	"autogal_largeimgnewwindow" => 0,
	"autogal_showtitleingall" => 1,
	# 2.20
	"autogal_metacommentsbb" => 1,
	"autogal_apacheindexignore" => 0,
	"autogal_apachedenyexts" => 0,
	"autogal_apacheleechprotect" => 0,
	"autogal_apacheallowedsites" => '',
	"autogal_apacheleechimage" => '',
	"autogal_randomdefaultimg" => 0,
	"autogal_sortnewcreation" => 0,
);

$eplug_done = "
$eplug_name Installation Successful!<br />
<br />
A link named \"$eplug_link_name\" has been placed in your main links. You can rename it in the \"Links\" admin menu. Place your images and directories (through FTP) in the \"e107_plugins/autogallery/Gallery\" folder.<br />
<br />
<font color='red'><b>!!!!IMPORTANT!!!!</b></font><br />
Please run the <a href='".e_PLUGIN."$eplug_folder/admin_dochmod.php'>chmod script</a> to complete!<br />
<br />";

$upgrade_add_prefs = array();
$prefVersions = array(); 
$versionNotes = '';

######################
# VERSION 1.00
######################
if ($autoGalVer < 1.00)
{
	$prefVersions[] = "1.00";
	$verPrefs = array
	(
		"autogal_revuploaduc" => 253,
		"autogal_uploadmaxsize" => 1000000,
		"autogal_emailtofriend" => 1,
		"autogal_numgallcols" => 2,
		"autogal_defaultetfcom" => "Check this out!",
	);
	$upgrade_add_prefs += $verPrefs;
}

######################
# VERSION 1.50
######################
if ($autoGalVer < 1.50)
{
	$prefVersions[] = "1.50";
	$verPrefs = array
	(
		"autogal_maximagewidth" => 800,
		"autogal_maximageheight" => 600,
		"autogal_maxperpage" => 20,
		"autogal_gallerydir" => "",	
	);
	
	$upgrade_add_prefs += $verPrefs;
}

######################
# VERSION 1.60
######################
if ($autoGalVer < 1.60)
{	
	$prefVersions[] = "1.60";
	$verPrefs = array
	(
		"autogal_showautogalver" => 1,
		"autogal_showadminmenu" => 1,
		"autogal_uploadnumber" => 5,
	);
	$upgrade_add_prefs += $verPrefs;
}

######################
# VERSION 1.70
######################
if ($autoGalVer < 1.70)
{	
	$prefVersions[] = "1.70";
	$verPrefs = array
	(
		"autogal_chmodwarnoff" => 0,
	);
	$upgrade_add_prefs += $verPrefs;
}

######################
# VERSION 1.80
######################
if ($autoGalVer < 1.80)
{	
	$prefVersions[] = "1.80";
	$verPrefs = array
	(
		"autogal_adminreviewuc" => 254,
		"autogal_showsubtitlesgal" => 1,
		"autogal_flashwidth" => 550,
		"autogal_flashheight" => 400,
	);
	$upgrade_add_prefs += $verPrefs;
}

######################
# VERSION 1.83
######################
if ($autoGalVer < 1.83)
{
	$prefVersions[] = "1.83";
	$verPrefs = array
	(
		"autogal_imkanigif1st" => 1,
		"autogal_defimgwidth" => 150,
		"autogal_defimgheight" => 150,
	);
	$upgrade_add_prefs += $verPrefs;
}

######################
# VERSION 1.84
######################
if ($autoGalVer < 1.84)
{
	$prefVersions[] = "1.84";
	$verPrefs = array
	(
		"autogal_shownewest" => 1,
		"autogal_shownewestinroot" => 1,
	);
	$upgrade_add_prefs += $verPrefs;
}

######################
# VERSION 1.90
######################
if ($autoGalVer < 1.90)
{
	$prefVersions[] = "1.90";
	$verPrefs = array
	(
		"autogal_showinnewwindow" => 0,
		"autogal_newwindowargs" => 'width=800,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes',
		"autogal_moviewidth" => 550,
		"autogal_movieheight" => 400,
	);
	$upgrade_add_prefs += $verPrefs;
}

######################
# VERSION 2.00
######################
if ($autoGalVer < 2.00)
{
	$prefVersions[] = "2.00";
	$verPrefs = array
	(
		"autogal_autothumb" => 1,
		"autogal_metaon" => 0,
		"autogal_metacomments" => 0,
		"autogal_metaviewhits" => 0,
		"autogal_metaemailhits" => 0,
		"autogal_titleheadstyle" => 1,
		"autogal_showerrorlog" => 1,
		"autogal_generatedebuglog" => 0,
		"autogal_enablesearch" => 1,
		"autogal_searchmaxresults" => 20,
		"autogal_xmlsearch" => 1,
	);
	$upgrade_add_prefs += $verPrefs;
}

######################
# VERSION 2.10
######################
if ($autoGalVer < 2.10)
{
	$prefVersions[] = "2.10";
	$verPrefs = array
	(
		"autogal_largeimgnewwindow" => 0,
		"autogal_showtitleingall" => 1,
	);
	$upgrade_add_prefs += $verPrefs;
}

######################
# VERSION 2.20
######################
if ($autoGalVer < 2.20)
{
	$prefVersions[] = "2.20";
	$verPrefs = array
	(
		"autogal_metacommentsbb" => 1,
		"autogal_apacheindexignore" => 0,
		"autogal_apachedenyexts" => 0,
		"autogal_apacheleechprotect" => 0,
		"autogal_apacheallowedsites" => '',
		"autogal_apacheleechimage" => '',
		"autogal_randomdefaultimg" => 0,
		"autogal_sortnewcreation" => 0,
	);
	$upgrade_add_prefs += $verPrefs;
	
	$versionNotes .= "<u>2.20</u><br />For this version you will lose all of your gallery user classes, 
	you must reset them all. In addition to this you must also manually move Gallery.xml from the base 
	directory to the 'Configuration' gallery if you wish to keep meta information for the root gallery
	(such as comments). Please also run the chmod script.<br /><br />";
	
}


$upgrade_alter_tables = array(
"CREATE TABLE ".MPREFIX."scores (
scoreid INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
userid INT(10) UNSIGNED NOT NULL,
gamename VARCHAR(100) NOT NULL,
score INT(10) UNSIGNED NOT NULL,
date INT(10) UNSIGNED NOT NULL,
PRIMARY KEY  (scoreid)
) TYPE=MYISAM AUTO_INCREMENT=1;");


$eplug_upgrade_done = "
$eplug_name Upgrade Successfull!<br />
<br />
Preferences Settings Added for Version".(count($prefVersions) > 1 ? 's' : '').": ".implode(", ", $prefVersions)."<br />
".($versionNotes ? "<br /><b>Version Notes:</b><br />$versionNotes" : '<br />')."
<b>Please run <a href='".e_PLUGIN."$eplug_folder/admin_dochmod.php'>chmod script</a> to complete</b><br />
<br />
<a href='".e_PLUGIN."$eplug_folder/$eplug_conffile'>Admin Auto Gallery</a>";

?>