diff options
author | rvelices <rv-github@modusoptimus.com> | 2007-01-09 11:38:54 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2007-01-09 11:38:54 +0000 |
commit | b910549db2dc6e5b62750ac6faa68ea406d7b142 (patch) | |
tree | cb0e93aac7fc6d54adedc8230a8e7d16f4a20fb7 /plugins/admin_advices | |
parent | c841c568f6d6f098fc097b7d8ee06c8602aa03d4 (diff) |
Plugins: new way of adding links and content to administration pages...
git-svn-id: http://piwigo.org/svn/trunk@1705 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'plugins/admin_advices')
-rw-r--r-- | plugins/admin_advices/main.inc.php | 33 |
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');
}
}
|