diff -r 2d410dc8c1f3 -r 8e3a5a6fc63e web/wp-content/themes/IRI-Theme/functions.php
--- a/web/wp-content/themes/IRI-Theme/functions.php Tue Mar 16 14:14:44 2010 +0000
+++ b/web/wp-content/themes/IRI-Theme/functions.php Thu Mar 18 09:56:33 2010 +0000
@@ -1,5 +1,19 @@
';
+ $flashtag .= '';
+ // ------------------------------------------------------------------------------------
+ $flashtag .= '
';
+ if( $options['showwptags'] == 'true' ){ $flashtag .= '
'; } else { $flashtag .= '
'; };
+ // alternate content
+ if( $options['mode'] != "cats" ){ $flashtag .= urldecode($tagcloud); }
+ if( $options['mode'] != "tags" ){ $flashtag .= urldecode($cats); }
+ $flashtag .= '
';
+ $flashtag .= '';
+ } else {
+ $flashtag = '';
+ }
+ return $flashtag;
+}
+
+// Copy of the current category widget plugin adapted to xiliml
+function xilimlSam_post_of_current_category (){
+ global $wpdb;
+
+ $defaults = array(
+ 'limit' => 30,
+ 'AscDesc' => "DSC",
+ 'OrderBy' =>'ID',
+ );
+
+ $args = $defaults;
+ $lang = the_curlang();//echo ($lang);
+ extract($args);
+
+ $limit = (int) abs($limit);
+
+ if(is_category()){
+ $curCategoryID = get_query_var('cat');
+ }
+
+ if (is_single()) {
+ $curCategoryID = '';
+
+ foreach (get_the_category() as $catt) {
+ $curCategoryID .= $catt->cat_ID.' ';
+ }
+
+ $curCategoryID = str_replace(" ", ",", trim($curCategoryID));
+ }
+
+ if (!intval($curCategoryID)) $curCategoryID='';
+ $query = "&category=$curCategoryID&showposts=$limit&orderby=$OrderBy&order=$AscDesc";
+ $posts = get_posts($query); //get posts
+ $postlist = '';
+
+ foreach ($posts as $post) {
+
+ $CurLang = get_cur_post_lang_dir ($post->ID);//echo ($post->ID."-> ".$CurLang["lang"]."
");
+ if($CurLang["lang"]==$lang){
+ $post_title_s = htmlspecialchars(stripslashes(cache_cutter($post->post_title)));
+ $post_title_l = htmlspecialchars(stripslashes(text_cutter($post->post_title,200)));
+ $postlist .= ' ' . $post_title_l . ' ';
+ }
+ }
+
+ echo '';
+ echo $postlist;
+ echo '
';
+
+}
+
+#
+function xilimlSam_page2cat_output_Hook($cat){
+
+ if( function_exists(page2cat_output) and function_exists(xiliml_the_other_posts) ){
+
+ global $wpdb;
+ $mypage = $wpdb->get_row("SELECT * FROM {$wpdb->page2cat} WHERE cat_ID = '".$cat."';",OBJECT);
+ $pageid = $mypage->page_ID;
+ $pageInOtherLang = xiliml_the_other_posts ($pageid,'','','array');
+
+ if($pageInOtherLang[the_curlang()]!=null){
+ $pageid=$pageInOtherLang[the_curlang()];
+ }
+
+ if($pageid != ""):
+
+ switch($style):
+
+ case 'inline':
+ default:
+ ?>
+
+ ".$MyPost[$current_lang['lang']]);
+
+ if (in_array($current_lang['lang'],$MyPost)){
+ return ($post_ID);
+ } else {
+ return ($MyPost[$current_lang['lang']]);
+
+ }
+ */
+}
+
+#
+function xilimlSam_other_posts($post_ID){
+
+ if (class_exists('xili_language')) {
+
+ $current_lang = the_cur_lang_dir();
+
+ $MyPost = xiliml_the_other_posts($post_ID,"","","array");
+ //var_dump($MyPost);
+ //echo($current_lang['lang']." -> ".$MyPost[$current_lang['lang']]);
+
+ if (in_array($current_lang['lang'],$MyPost)){
+ return ($post_ID);
+ } else {
+ return ($MyPost[$current_lang['lang']]);
+
+ }
+
+ } else {
+ return ($post_ID);
+ }
+
+}
+
+#
+function xilimlSam_other_pages($post_ID){
+
+ if (class_exists('xili_language')) {
+
+ $current_lang = the_cur_lang_dir();
+
+ $MyPost = xiliml_the_other_posts($post_ID,"","","array");
+ //var_dump($MyPost);
+ //echo($current_lang['lang']." -> ".$MyPost[$current_lang['lang']]);
+
+ if (in_array($current_lang['lang'],$MyPost)){
+ return ($post_ID);
+ } else {
+ return ($MyPost[$current_lang['lang']]);
+
+ }
+
+ } else {
+ return ($post_ID);
+ }
+}
+
# Displays a list of categories
function dp_list_categories($Eparam='') {
+ if (class_exists('xili_language')) {
+ $current_lang = the_cur_lang_dir();
+ }
+
$categories = get_categories('hide_empty=1'.$Eparam);
$first = true;
$count = 0;
@@ -78,18 +369,60 @@
if ($category->parent<1) {
echo ('