Ignore:
Timestamp:
Jan 10, 2010, 4:38:45 PM (14 years ago)
Author:
vdigital
Message:

[Update] For Juza - Juza Theme is full working (On Standard Piwigo Gallery).

Recommended organization: Don't mixed Pictures and subcategories in a category.
Next step - Response time checking.
To see I will raise a locked gallery.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Juza/include/functions.inc.php

    r4537 r4659  
    33  global $template;
    44  Juza_update();
    5   $template->set_filenames(array('juza' => 'theme/Juza/script.tpl'));
     5  $template->set_filenames(array(
     6    'juza' => 'theme/Juza/script.tpl',
     7    'juzabar' => 'theme/Juza/Juzabar.tpl',
     8    'juzaconfig' => 'theme/Juza/include/Juzaconfig.tpl',
     9  ));
     10  include_once(PHPWG_ROOT_PATH.'include/menubar.inc.php');
    611  $template->parse('juza');
     12  $template->parse('juzabar');
     13  $template->parse('juzaconfig');
    714}
    815
     
    4451}
    4552
     53function Juza_common_tags($max_tags)
     54{
     55   $query = '
     56SELECT t.*, count(*) AS counter
     57  FROM '.IMAGE_TAG_TABLE.'
     58    INNER JOIN '.TAGS_TABLE.' t ON tag_id = id
     59  GROUP BY tag_id
     60  ORDER BY counter DESC
     61  LIMIT 0,' . $max_tags . ';';
     62  $result = pwg_query($query);
     63  $tags = array();
     64  while($row = mysql_fetch_assoc($result)) {
     65    array_push($tags, $row);
     66  }
     67  usort($tags, 'tag_alpha_compare');
     68  return $tags;
     69}
     70
     71function Juza_tags( $ref_back ) {
     72  $menu = & $ref_back[0];
     73  $block = $menu->get_block( 'mbTags' );
     74  if ( count($block->data) > 0 ) return;
     75  $tags = Juza_common_tags(10);
     76  $tags = add_level_to_tags($tags);
     77  foreach ($tags as $tag) {
     78    $block->data[] = array_merge( str_replace(' ', ' ', $tag),
     79        array(
     80          'URL' => make_index_url( array( 'tags' => array($tag) ) ),
     81          'U_ADD' => make_index_url( array( 'tags' => array($tag) ) ),
     82          )
     83      );
     84  }
     85  $block->template = 'menubar_tags.tpl';
     86}
     87
    4688function remove_AkBookStyle_handlers() {
    4789  global $public_content;
     
    5799  if (isset($conf['Juza Config'])) $conf_Juza = array_merge($conf_Juza, unserialize($conf['Juza Config']));
    58100  if (isset($_POST['Juza_submit'])) {
    59     $conf_Juza['Juza_handlers'] = isset($_POST['Juza_handlers']) ? true:false;
    60101    $conf_Juza['Juza_width'] = isset($_POST['Juza_width']) ? (integer)$_POST['Juza_width'] : 885;
    61102    $conf_Juza['Juza_width'] = ($conf_Juza['Juza_width'] > 885) ? 885 : $conf_Juza['Juza_width'];
     
    84125    pwg_query($query);
    85126  }
    86   $conf['Juza_active'] = (!isset($conf_Juza['Juza_handlers'])) ? true:$conf_Juza['Juza_handlers'];
    87127
    88   if ( is_admin() ) {
    89     $template->append('footer_elements', '<form method="post" name="JuzaTC"  action="' . make_index_url() . '">
    90 <input name="Juza_config" type="submit" value="'. l10n('Juza Theme Configuration') .'" class="conf" />
    91 <input type="hidden" value="true" name="Juza_conf" />
    92 </form>');
    93   }
    94   if ( isset($_POST['Juza_conf']) ) $template->assign('Juza_config', true);
    95   if ($conf['Juza_active']) $template->assign('Juza_active', true);
    96   if ($conf_Juza['Juza_handlers']) $template->assign('Juza_handlers', 'checked="checked"');
     128  $template->assign('Juza_config', true);
     129
    97130  $user["expand"] = true;
    98131  $template->assign('Juza_cats', get_categories_menu());
     
    106139  $template->assign('Juza_shift3', -(12+$conf_Juza['Juza_height']));
    107140  if ($conf_Juza['Juza_Auto_CS']) $template->assign('Juza_Auto_CS', 'checked="checked"');
    108   if (isset($_POST['Juza_close'])) {
    109     redirect(make_index_url());
    110   }
    111141}
    112142function Juza_default() {
    113143  return array(
    114     'Juza_handlers' => true,
    115144    'Juza_width'    => 885,
    116145    'Juza_height'   => 240,
Note: See TracChangeset for help on using the changeset viewer.