mirror of
https://github.com/e107inc/e107.git
synced 2025-07-30 11:20:25 +02:00
More shortcode converting
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id: siteinfo_shortcodes.php,v 1.2 2009-01-09 01:12:17 mcfly_e107 Exp $
|
||||
* $Id: siteinfo_shortcodes.php,v 1.3 2009-01-09 13:10:01 mcfly_e107 Exp $
|
||||
*
|
||||
* Siteinfo shortcode batch
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$codes = array('sitebutton', 'sitedisclaimer', 'sitename', 'sitedescription', 'sitetag');
|
||||
$codes = array('sitebutton', 'sitedisclaimer', 'sitename', 'sitedescription', 'sitetag', 'logo', 'theme_disclaimer');
|
||||
register_shortcode('siteinfo_shortcodes', $codes);
|
||||
|
||||
class siteinfo_shortcodes
|
||||
@@ -41,5 +41,51 @@ class siteinfo_shortcodes
|
||||
return SITETAG;
|
||||
}
|
||||
|
||||
function get_logo($parm)
|
||||
{
|
||||
parse_str($parm); // Optional {LOGO=file=file_name} or {LOGO=link=url} or {LOGO=file=file_name&link=url}
|
||||
// Paths to image file, link are relative to site base
|
||||
|
||||
if (isset($file) && $file && is_readable($file))
|
||||
{
|
||||
$logo = e_HTTP.$file; // HTML path
|
||||
$path = e_BASE.$file; // PHP path
|
||||
}
|
||||
else if (is_readable(THEME.'images/e_logo.png'))
|
||||
{
|
||||
$logo = THEME_ABS.'images/e_logo.png'; // HTML path
|
||||
$path = THEME.'images/e_logo.png'; // PHP path
|
||||
}
|
||||
else
|
||||
{
|
||||
$logo = e_IMAGE_ABS.'logo.png'; // HTML path
|
||||
$path = e_IMAGE.'logo.png'; // PHP path
|
||||
}
|
||||
|
||||
$dimensions = getimagesize($path);
|
||||
|
||||
$image = "<img class='logo' src='".$logo."' style='width: ".$dimensions[0]."px; height: ".$dimensions[1]."px' alt='".SITENAME."' />\n";
|
||||
|
||||
if (isset($link) && $link)
|
||||
{
|
||||
if ($link == 'index')
|
||||
{
|
||||
$image = "<a href='".e_HTTP."index.php'>".$image."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$image = "<a href='".e_HTTP.$link."'>".$image."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
return $image;
|
||||
}
|
||||
|
||||
function get_theme_disclaimer($parm)
|
||||
{
|
||||
global $pref;
|
||||
return (defined('THEME_DISCLAIMER') && $pref['displaythemeinfo'] ? THEME_DISCLAIMER : '');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
@@ -1,36 +0,0 @@
|
||||
parse_str($parm); // Optional {LOGO=file=file_name} or {LOGO=link=url} or {LOGO=file=file_name&link=url}
|
||||
// Paths to image file, link are relative to site base
|
||||
|
||||
if (isset($file) && $file && is_readable($file))
|
||||
{
|
||||
$logo = e_HTTP.$file; // HTML path
|
||||
$path = e_BASE.$file; // PHP path
|
||||
}
|
||||
else if (is_readable(THEME."images/e_logo.png"))
|
||||
{
|
||||
$logo = THEME_ABS."images/e_logo.png"; // HTML path
|
||||
$path = THEME."images/e_logo.png"; // PHP path
|
||||
}
|
||||
else
|
||||
{
|
||||
$logo = e_IMAGE_ABS."logo.png"; // HTML path
|
||||
$path = e_IMAGE."logo.png"; // PHP path
|
||||
}
|
||||
|
||||
$dimensions = getimagesize($path);
|
||||
|
||||
$image = "<img class='logo' src='".$logo."' style='width: ".$dimensions[0]."px; height: ".$dimensions[1]."px' alt='".SITENAME."' />\n";
|
||||
|
||||
if (isset($link) && $link)
|
||||
{
|
||||
if ($link == 'index')
|
||||
{
|
||||
$image = "<a href='".e_HTTP."index.php'>".$image."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$image = "<a href='".e_HTTP.$link."'>".$image."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
return $image;
|
@@ -1,3 +0,0 @@
|
||||
global $tp;
|
||||
$ret =(defined("THEME_DISCLAIMER") && $pref['displaythemeinfo'] ? THEME_DISCLAIMER : "");
|
||||
return $ret;
|
Reference in New Issue
Block a user