mirror of
https://github.com/e107inc/e107.git
synced 2025-02-21 06:52:28 +01:00
commit
e09a22198d
12
README.md
12
README.md
@ -1,6 +1,6 @@
|
||||
## e107 [Content Management System][1] (CMS) - v2
|
||||
|
||||
[](https://gitter.im/e107inc/e107?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
[](https://gitter.im/e107inc/e107?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
### What is e107?
|
||||
e107 is a free (open-source) content management system which allows you to easily manage and publish your content online. Developers can save time in building websites and powerful online applications. Users can avoid programming completely! Blogs, Websites, Intranets - e107 does it all.
|
||||
@ -24,12 +24,18 @@ You may report any bugs or feature requests on GitHub (https://github.com/e107in
|
||||
|
||||
* Please submit 1 pull-request for each Github #issue you may work on.
|
||||
* Make sure that only the lines you have changed actually show up in a file-comparison (diff) ie. some text-editors alter every line so this should be avoided.
|
||||
* Make sure you are using rebase on your local .git/config file.
|
||||
ie. [branch "master"]
|
||||
rebase = true`
|
||||
|
||||
### Donations
|
||||
If you like e107 and wish to help it to improve - please consider making a small donation.
|
||||
|
||||
Bitcoin address: 18C7W2YvkzSjvPoW1y46PjkTdCr9UzC3F7
|
||||
* Bitcoin address: 18C7W2YvkzSjvPoW1y46PjkTdCr9UzC3F7
|
||||
* Paypal: donate (at) e107.org
|
||||
|
||||
### Support
|
||||
* http://e107help.org
|
||||
|
||||
### License
|
||||
|
||||
|
@ -857,7 +857,7 @@ class e_parse_shortcode
|
||||
}
|
||||
|
||||
|
||||
if(preg_match('/^([A-Z_]*):(.*)/', $matches[1], $newMatch))
|
||||
if(preg_match('/^([A-Z_]*\d?):(.*)/', $matches[1], $newMatch))
|
||||
{
|
||||
$fullShortcodeKey = $newMatch[0];
|
||||
$code = $newMatch[1];
|
||||
|
@ -120,7 +120,7 @@ define ('EPL_ADLAN_101',"No plugins installed - [x].");
|
||||
define ('EPL_ADLAN_102',"This Wizard will build an admin area for your plugin and generate a plugin.xml meta file. Before you start:");
|
||||
define ('EPL_ADLAN_103',"Create a new writable folder in the [x] directory eg. [b]myplugin[/b]");
|
||||
// define ('EPL_ADLAN_104',"If your plugin will use sql tables, create a new file in this folder and name it the same as the directory but with [b]_sql.php[/b] as a sufix eg. [b]myplugin_sql.php[/b]");
|
||||
define ('EPL_ADLAN_105',"Create your table in phpMyAdmin in the same database as e107 and with the same table prefix.");
|
||||
define ('EPL_ADLAN_105',"Create your table using phpMyAdmin in the same database as e107 and with the same table prefix. eg. [b]e107_myplugin[/b]");
|
||||
define ('EPL_ADLAN_106',"Select your plugin's folder to begin.");
|
||||
define ('EPL_ADLAN_107',"Build an admin-area and xml file for:");
|
||||
define ('EPL_ADLAN_108',"Check language files:");
|
||||
|
@ -8,9 +8,6 @@
|
||||
*
|
||||
* Banner shortcode
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* e107 Banner management plugin
|
||||
*
|
||||
* Handles the display and sequencing of banners on web pages, including counting impressions
|
||||
@ -21,47 +18,28 @@
|
||||
|
||||
class banner_shortcodes extends e_shortcode
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
// $parm now can be array, old campaign $parm still allowed....
|
||||
function sc_banner($parm='')
|
||||
{
|
||||
// $parm now can be array, old campaign $parm still allowed....
|
||||
|
||||
$sql = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
|
||||
mt_srand ((double) microtime() * 1000000);
|
||||
$seed = mt_rand(1,2000000000);
|
||||
$time = time();
|
||||
|
||||
if(is_array($parm))
|
||||
{
|
||||
$parms = eHelper::scParams($parm);
|
||||
$campaign = $parms['campaign'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$campaign = $parm;
|
||||
}
|
||||
$campaign = (is_array($parm)?$parm['campaign']:$parm);
|
||||
$query = " (banner_startdate=0 OR banner_startdate <= {$time}) AND (banner_enddate=0 OR banner_enddate > {$time}) AND (banner_impurchased=0 OR banner_impressions<=banner_impurchased)".($campaign ? " AND banner_campaign='".$tp->toDB($campaign)."'" : '')."
|
||||
AND banner_active IN (".USERCLASS_LIST.") ";
|
||||
|
||||
if($tags = e107::getRegistry('core/form/related'))
|
||||
{
|
||||
$tags_regexp = "'(^|,)(".str_replace(",", "|", $tags).")(,|$)'";
|
||||
$query .= " AND banner_keywords REGEXP ".$tags_regexp;
|
||||
}
|
||||
|
||||
$query .= " ORDER BY RAND($seed) LIMIT 1";
|
||||
|
||||
|
||||
|
||||
if($sql->select('banner', 'banner_id, banner_image, banner_clickurl, banner_description', $query))
|
||||
{
|
||||
$row = $sql->fetch();
|
||||
return $this->renderBanner($row, $parm);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -74,11 +52,6 @@ class banner_shortcodes extends e_shortcode
|
||||
{
|
||||
$sql = e107::getDb('banner');
|
||||
$tp = e107::getParser();
|
||||
if(is_array($parm))
|
||||
{
|
||||
$parms = eHelper::scParams($parm);
|
||||
}
|
||||
|
||||
if(!$row['banner_image'])
|
||||
{
|
||||
return "<a href='".e_HTTP.'banner.php?'.$row['banner_id']."' rel='external'>no image assigned to this banner</a>";
|
||||
@ -109,7 +82,6 @@ class banner_shortcodes extends e_shortcode
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
if($row['banner_image'][0] == '{')
|
||||
{
|
||||
$src = $row['banner_image'];
|
||||
@ -119,31 +91,21 @@ class banner_shortcodes extends e_shortcode
|
||||
$src = e_IMAGE_ABS.'banners/'.$row['banner_image'];
|
||||
$style = "'border:0'";
|
||||
}
|
||||
$class = vartrue($parms['class']) ? $parms['class'] : "e-banner img-responsive img-rounded";
|
||||
$ban_ret = $tp->toImage($src, array('class'=>$class, 'alt'=>$row['banner_clickurl'], 'style'=>$style));
|
||||
// Somehow, can't use vartrue core function when referencing $parm['class'], gives bug....
|
||||
$ban_ret = $tp->toImage($src, array('class'=>($parm['class'] == ''?"e-banner img-responsive img-rounded":$parm['class']) , 'alt'=>$row['banner_clickurl'], 'style'=>$style));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$tooltip = varset($row['banner_tooltip'],'');
|
||||
|
||||
$start = "<a class='e-tip' href='".e_HTTP.'banner.php?'.$row['banner_id']."' rel='external' title=\"".$tp->toAttribute($tooltip)."\">";
|
||||
$item = $ban_ret;
|
||||
$start = "<a class='e-tip' href='".e_HTTP.'banner.php?'.$row['banner_id']."' rel='external' title=\"".$tp->toAttribute(varset($row['banner_tooltip'],''))."\">";
|
||||
$end = '</a>';
|
||||
|
||||
$text = $start.$item.$end;
|
||||
|
||||
$text = $start.$ban_ret.$end;
|
||||
|
||||
if(!empty($row['banner_description']))
|
||||
{
|
||||
$text .= "<div class='e-banner-description'>".$start.$tp->toHtml($row['banner_description'], true).$end. "</div>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user