aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/admin_advices/main.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--plugins/admin_advices/main.inc.php33
1 files changed, 16 insertions, 17 deletions
diff --git a/plugins/admin_advices/main.inc.php b/plugins/admin_advices/main.inc.php
index a17f5a658..172cdf489 100644
--- a/plugins/admin_advices/main.inc.php
+++ b/plugins/admin_advices/main.inc.php
@@ -10,16 +10,15 @@ add_event_handler('loc_begin_page_tail', 'set_admin_advice' );
function set_admin_advice()
{
- global $page, $user, $template, $conf;
+ global $page, $user, $template, $conf;
// This Plugin works only on the Admin page
if ( isset($page['body_id']) and $page['body_id']=='theAdminPage'
- and isset($page['page']['name']) and $page['page']['name'] == 'intro'
- and isset($page['page']['type']) and $page['page']['type'] == 'standard'
+ and $page['page'] == 'intro'
)
{
- // Setup Advice Language (Maybe there is already a variable)
- $advlang = ( isset($user['language']) ) ?
+ // Setup Advice Language (Maybe there is already a variable)
+ $advlang = ( isset($user['language']) ) ?
$user['language'] : $conf['default_language']; // en_UK.iso-8859-1
$adv = array();
@@ -30,22 +29,22 @@ function set_admin_advice()
// If there is an advice
if ( $cond )
- {
-// $template->set_filenames( array( 'advice' => 'admin_advices.tpl' ));
+ {
+// $template->set_filenames( array( 'advice' => 'admin_advices.tpl' ));
$template->set_filenames(array(
- 'admin_advice' =>
+ 'admin_advice' =>
PHPWG_ROOT_PATH.'/plugins/admin_advices/admin_advices.tpl')
);
-
+
// Random Thumbnail
$query = '
SELECT *
FROM '.IMAGES_TABLE.'
ORDER BY RAND(NOW())
LIMIT 0, 1
-;';
- $result = pwg_query($query);
- $row = mysql_fetch_assoc($result);
+;';
+ $result = pwg_query($query);
+ $row = mysql_fetch_assoc($result);
if ( is_array($row) )
{
$template->assign_block_vars(
@@ -56,12 +55,12 @@ SELECT *
'IMAGE_TITLE' => $row['name'],
)
);
- }
+ }
$advice_text = array_shift($adv);
$template->assign_vars(
array(
- 'ADVICE_ABOUT' => '$conf[' . "'$confk'] ",
- 'ADVICE_TEXT' => $advice_text,
+ 'ADVICE_ABOUT' => '$conf[' . "'$confk'] ",
+ 'ADVICE_TEXT' => $advice_text,
)
);
foreach ($adv as $advice)
@@ -71,8 +70,8 @@ SELECT *
array(
'ADVICE' => $advice
)
- );
- }
+ );
+ }
$template->parse('admin_advice');
}
}