Changeset 4659 for extensions/Juza/include/functions.inc.php
- Timestamp:
- Jan 10, 2010, 4:38:45 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Juza/include/functions.inc.php
r4537 r4659 3 3 global $template; 4 4 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'); 6 11 $template->parse('juza'); 12 $template->parse('juzabar'); 13 $template->parse('juzaconfig'); 7 14 } 8 15 … … 44 51 } 45 52 53 function Juza_common_tags($max_tags) 54 { 55 $query = ' 56 SELECT 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 71 function 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 46 88 function remove_AkBookStyle_handlers() { 47 89 global $public_content; … … 57 99 if (isset($conf['Juza Config'])) $conf_Juza = array_merge($conf_Juza, unserialize($conf['Juza Config'])); 58 100 if (isset($_POST['Juza_submit'])) { 59 $conf_Juza['Juza_handlers'] = isset($_POST['Juza_handlers']) ? true:false;60 101 $conf_Juza['Juza_width'] = isset($_POST['Juza_width']) ? (integer)$_POST['Juza_width'] : 885; 61 102 $conf_Juza['Juza_width'] = ($conf_Juza['Juza_width'] > 885) ? 885 : $conf_Juza['Juza_width']; … … 84 125 pwg_query($query); 85 126 } 86 $conf['Juza_active'] = (!isset($conf_Juza['Juza_handlers'])) ? true:$conf_Juza['Juza_handlers'];87 127 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 97 130 $user["expand"] = true; 98 131 $template->assign('Juza_cats', get_categories_menu()); … … 106 139 $template->assign('Juza_shift3', -(12+$conf_Juza['Juza_height'])); 107 140 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 }111 141 } 112 142 function Juza_default() { 113 143 return array( 114 'Juza_handlers' => true,115 144 'Juza_width' => 885, 116 145 'Juza_height' => 240,
Note: See TracChangeset
for help on using the changeset viewer.