getbySEOURL($seodata["seourl"],0); $sel=$nr->cat_id; } else if($seodata["type"]=="a" && $seodata["seourl"]!="") { $ar=new ArticleDBRecord($dbconn); $ar->getbySEOURL($seodata["seourl"],0); $artid=$ar->art_id; $_SESSION["ses_locale"]=$ar->locale; if (intval($_SESSION["ses_locale"])==0) $_SESSION["ses_locale"]=$DEFLOC; } } // caching techniques if($_CACHE_TIME>0 && intval($_GET["artid"])>0 && !$_GET["preview"] && $query=="" && !$_GET["pf"]) { // start caching $docache=true; $_f=decideCacheFilename(); if($_f) { $_ts=@filemtime($_CACHE_DIR.$_f); if($_ts) { if($_ts+$_CACHE_TIME>=time()) { // show cached page print file_get_contents($_CACHE_DIR.$_f); //print "cached on ".date("d/m/Y H:i:s",$_ts); exit(); } } } } else $docache=false; // create sitemap if($_GET['preview']=='true') //condition to provide preview capability from console $cm=new CategoryMap($dbconn,"","",1,$_SESSION["ses_locale"]); else $cm=new CategoryMap($dbconn,"I","<>",1,$_SESSION["ses_locale"]); // no parameters, it's home if($sel<=0 && $artid<=0) $sel=$HOMEPAGENODEID; // get Articles $al=new ArticleList(); if($artid>0) { $ar=new ArticleDBRecord($dbconn); $ar->art_id=$artid; $ar->by_locale = $_SESSION['ses_locale']; $ar->get(); if($sel<=0) $sel=$ar->getCategory(); $ar->cat_id=$sel; $ar->parent_id=$cm->getParent($sel); if($sel!=$HOMEPAGENODEID)$al->list[0]=$ar; if ($start==0) $ar->incrementViews(); // ?na mpei se tag pou dixnei to fulltxt } else { $al->by_status="3"; // only Published articles $al->status_comp="="; $al->full_info=true; $al->only_active_today=true; // get non-expired articles $al->by_locale=$_SESSION["ses_locale"]; $al->sort_order="a.createdate"; $al->sorting="DESC"; $al->getArticlesOfNode($dbconn,$sel,1,1); } $art_count=count($al->list); // get path if(!$path) $path=$cm->getPath($sel); $curr_level=count($path); // get Node info and see if Public or Private $nr=new CategoryDBRecord($dbconn); $nr->get($sel); if($nr->status=="P" && $_SESSION["mem_id"]<=0) { // header("Location: member_login.php?artid=".$artid."&sel=".$sel); // exit(); if (!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic realm="Site auth"'); header('HTTP/1.0 401 Unauthorized'); echo 'You have to authenticate to see this page!\n'; exit(); } else { $mr=new MemberDBRecord($dbconn); $mr->auth($PHP_AUTH_USER,$PHP_AUTH_PW,$sel); if($mr->member_id>0) { $_SESSION["mem_id"]=$mr->member_id; $_SESSION["mem_username"]=$mr->username; } else { header('WWW-Authenticate: Basic realm="Site auth"'); header('HTTP/1.0 401 Unauthorized'); echo 'You have to authenticate to see this page!\n'; exit(); } } } $nrloc=new CatlocDBRecord($dbconn); $nrloc->cat_id=$sel; $nrloc->locale=$_SESSION["ses_locale"]; $nrloc->get(); $locl=new LocaleList(); $locl->populate($dbconn); $loc_iso=$locl->getIso($_SESSION["ses_locale"]); // get Template -- search in the template tags [%#cccccc#%] $tempr=new TemplateDBRecord($dbconn); if($pf) $tempr->temp_id=9; else if ($artid>0 && $al->list[0]->temp_id>0) $tempr->temp_id=$al->list[0]->temp_id; else $tempr->temp_id=$cm->getTemplate($sel); $tempr->get(); //get template list $templs = new TemplateList(); $templs->full = 1; $templs->populate($dbconn,1,1); $html = $tempr->html; $html=includeTemplates($tempr->temp_id,$templs->list,$html); $PAGE = $html; //get column boxes $all_cat="'0'"; // [%RIGHT_COLUMN%] $RIGHT_COLUMN=""; $column_param=3; if(strstr($PAGE,"[%RIGHT_COLUMN%]")) { $_cl= new ColumnsList(); $_cl->populate($dbconn,$column_param,$tempr->temp_id,$path[1]->cat_id); $total_cb=count($_cl->list); if ($total_cb==0){ $_cl= new ColumnsList(); $_cl->populate($dbconn,$column_param,$tempr->temp_id,$all_cat); } for($i=0; $ilist); $i++){ $o=$_cl->list[$i]->boxtag_id; $RIGHT_COLUMN.=$boxtag[$column_param][$o]["tag"]; } $PAGE=str_replace("[%RIGHT_COLUMN%]",$RIGHT_COLUMN,$PAGE); include_once("content_boxes.php"); } require_once("content_banners.php"); // [%PAGE_TITLE%] $PAGE_TITLE=""; if(strstr($PAGE,"[%PAGE_TITLE%]")) { if($artid>0) $PAGE_TITLE=$al->list[0]->seo_title!=""?$al->list[0]->seo_title:$al->list[0]->title; else $PAGE_TITLE=$nrloc->seo_title!=""?$nrloc->seo_title:$nrloc->name; $PAGE_TITLE.=" | Self Esteem Center"; $PAGE=str_replace("[%PAGE_TITLE%]",$PAGE_TITLE,$PAGE); } // [%PAGE_KEYWORDS%] $PAGE_KEYWORDS=""; if(strstr($PAGE,"[%PAGE_KEYWORDS%]")) { if($artid>0) $PAGE_KEYWORDS=$al->list[0]->seo_keyw; else $PAGE_KEYWORDS=$nrloc->seo_keyw; $PAGE=str_replace("[%PAGE_KEYWORDS%]",$PAGE_KEYWORDS,$PAGE); } // [%PAGE_DESCRIPTION%] $PAGE_DESCRIPTION=""; if(strstr($PAGE,"[%PAGE_DESCRIPTION%]")) { if($artid>0) $PAGE_DESCRIPTION=$al->list[0]->seo_descr; else $PAGE_DESCRIPTION=$nrloc->seo_descr; if($PAGE_DESCRIPTION=="") $PAGE_DESCRIPTION=getSummary($al->list[0],200); if($start>0) $PAGE_DESCRIPTION=$PAGE_DESCRIPTION." - starting at ".$start; $PAGE=str_replace("[%PAGE_DESCRIPTION%]",$PAGE_DESCRIPTION,$PAGE); } // [%PATH%] $PATH=""; if($sel!=$HOMEPAGENODEID){ $PATH="getObject($HOMEPAGENODEID),$loc_iso)."\">".$cm->getName($HOMEPAGENODEID).""; for($i=1; $i<$curr_level; $i++) { $PATH.=" | ".$path[$i]->name.""; } } $PAGE=str_replace("[%PATH%]",$PATH,$PAGE); //[%HEADER_MENU%] $HEADER_MENU=""; $subs=$cm->getSubNodes($HEADERMENUNODEID,1); for($i=0; $i".$subs[$i]->name."\n"; } $PAGE=str_replace("[%HEADER_MENU%]",$HEADER_MENU,$PAGE); //[%MAIN_MENU%] $MAIN_MENU=""; $subs=$cm->getSubNodes($MAINMENUNODEID,1); for($i=0; $icat_id)?" class=\"on\"":"")." id='nav".($i+1)."'>".$subs[$i]->name.""; } $PAGE=str_replace("[%MAIN_MENU%]",$MAIN_MENU,$PAGE); //[%HEADER_BANNERS%] $HEADER_BANNERS=""; if(strstr($PAGE,"[%HEADER_BANNERS%]")) { $na = new ArticleList(); $na->getArticlesOfNode($dbconn,($sel==$HOMEPAGENODEID?$sel:$path[1]->cat_id), 1, 1, 0, 1); $hv = getRelatedAttachments($na->list[0]->art_id,2); if(count($hv)>0){ $HEADER_BANNERS.=""; } } $PAGE=str_replace("[%HEADER_BANNERS%]",$HEADER_BANNERS,$PAGE); //[%SLIDE_HOME%] $SLIDE_HOME=""; $SLIDE_BUTTONS=""; if(strstr($PAGE,"[%SLIDE_HOME%]")) { $sl = new ArticleList(); $sl->by_status="3"; // only Published articles $sl->status_comp="="; $sl->full_info=true; $sl->flags='H'; $sl->only_active_today=true; // get non-expired articles $sl->by_locale=$_SESSION["ses_locale"]; $sl->sort_order="a.art_order"; $sl->sorting="DESC"; $sl->getAllArticles($dbconn, 1, 1, 0, 3); for($i=0;$ilist);$i++){ $img = getRelatedAttachments($sl->list[$i]->art_id); if($img[3]->URI!=''){ $img_uri = $img[3]->URI; $img_title = $img[3]->ltitle; } else { $img_uri = $img[0]->URI; $img_title = $img[0]->ltitle; } $SLIDE_HOME.='
  • '.getSummary($sl->list[$i],400).'

  • '; $SLIDE_BUTTONS.=''.$sl->list[$i]->title.''; } } $PAGE=str_replace("[%SLIDE_HOME%]",$SLIDE_HOME,$PAGE); $PAGE=str_replace("[%SLIDE_BUTTONS%]",$SLIDE_BUTTONS,$PAGE); //[%HOME_DRAWER%] $HOME_DRAWER=""; if(strstr($PAGE,"[%HOME_DRAWER%]")) { for($i=0;$ipopulateCategPhotos($dbconn,$DRAWER_NODE[$i],$_SESSION["ses_locale"],$ATTYPE_MEDIA,1,1); $HOME_DRAWER.='
    '.$att->list[0]->ltitle.' '.$cm->getName($DRAWER_NODE[$i]).' & Αυτοεκτίμηση arrow
    '; $dr_subs = $cm->getSubNodes($DRAWER_NODE[$i],1); $DRAWER_CONTENT.='
      '; for($k=0;$kpopulateCategPhotos($dbconn,$dr_subs[$k]->cat_id,$_SESSION["ses_locale"],$ATTYPE_MEDIA,1,1); $DRAWER_CONTENT.='
    • '.$att2->list[0]->ltitle.''.$dr_subs[$k]->name.'
    • '; } $DRAWER_CONTENT.='
    '; } $PAGE=str_replace("[%HOME_DRAWER%]",$HOME_DRAWER,$PAGE); $PAGE=str_replace("[%DRAWER_CONTENT%]",$DRAWER_CONTENT,$PAGE); } //[%RELATED_ARTS_DRAWER%] $RELATED_ARTS_DRAWER=""; if(strstr($PAGE,"[%RELATED_ARTS_DRAWER%]")) { for($i=0;$ipopulateCategPhotos($dbconn,$DRAWER_NODE[$i],$_SESSION["ses_locale"],$ATTYPE_MEDIA,1,1); $RELATED_ARTS_DRAWER.='
    '.$att->list[0]->ltitle.' '.$cm->getName($DRAWER_NODE[$i]).' & Αυτοεκτίμηση arrow
    '; $dr_subs = $cm->getSubNodes($DRAWER_NODE[$i],1); $REL_DRAWER_CONTENT.='
      '; for($k=0;$kgetSubNodes($dr_subs[$k]->cat_id,1); if($rel_node=='') continue; $att2=new AttachmentList(); $att2->populateCategPhotos($dbconn,$dr_subs[$k]->cat_id,$_SESSION["ses_locale"],$ATTYPE_MEDIA,1,1); $REL_DRAWER_CONTENT.='
    • '.$att2->list[0]->ltitle.''.$dr_subs[$k]->name.'
    • '; } $REL_DRAWER_CONTENT.='
    '; } $PAGE=str_replace("[%RELATED_ARTS_DRAWER%]",$RELATED_ARTS_DRAWER,$PAGE); $PAGE=str_replace("[%REL_DRAWER_CONTENT%]",$REL_DRAWER_CONTENT,$PAGE); } //[%POIOI_EIMASTE%] & [%POIOI_EIMASTE_TEXT%] $POIOI_EIMASTE=""; $POIOI_EIMASTE_TEXT=""; if(strstr($PAGE,"[%POIOI_EIMASTE%]")) { $des = new ArticleDBRecord($dbconn); $des->status_comp="="; $des->full_info=true; $des->by_status="3"; $des->only_active_today=true; $des->getFirstOfNode($POIOIEIMASTEDESC); $POIOI_EIMASTE_TEXT='
    '.$des->title.'

    '.$des->fulltxt.'

    '; $plt = new ArticleList(); $plt->status_comp="="; $plt->by_status="3"; $plt->full_info=true; $plt->only_active_today=true; $plt->sort_order="a.art_order"; $plt->sorting="DESC"; $plt->getArticlesOfNode($dbconn, $POIOIEIMASTENODEID, 1, 1); for($i=0;$ilist);$i++){ $img = getRelatedAttachments($plt->list[$i]->art_id); // <- play button $POIOI_EIMASTE.='
  • '.$plt->list[$i]->title.' -
    '.$plt->list[$i]->shortdesc.'
  • '; } $PAGE=str_replace("[%POIOI_EIMASTE_TEXT%]",$POIOI_EIMASTE_TEXT,$PAGE); $PAGE=str_replace("[%POIOI_EIMASTE%]",$POIOI_EIMASTE,$PAGE); } //[%POIOI_EIMASTE_CONTENT%] $POIOI_EIMASTE_CONTENT=""; $POIOI_EIMASTE_OTHERS=""; if(strstr($PAGE,"[%POIOI_EIMASTE_CONTENT%]")) { $img = getRelatedAttachments($ar->art_id); //
    $POIOI_EIMASTE_CONTENT='
    '.$img[1]->ltitle.'
    '.$ar->title.'
    '.$ar->shortdesc.'
    '.$ar->fulltxt.'
    '; $plt = new ArticleList(); $plt->status_comp="="; $plt->by_status="3"; $plt->full_info=true; $plt->only_active_today=true; $plt->sort_order="a.art_order"; $plt->sorting="DESC"; $plt->getArticlesOfNode($dbconn, $POIOIEIMASTENODEID, 1, 1,0,999,$ar->art_id); for($i=0;$ilist);$i++){ $img = getRelatedAttachments($plt->list[$i]->art_id); // <- play button $POIOI_EIMASTE_OTHERS.='
  • '; } $PAGE=str_replace("[%POIOI_EIMASTE_CONTENT%]",$POIOI_EIMASTE_CONTENT,$PAGE); $PAGE=str_replace("[%POIOI_EIMASTE_OTHERS%]",$POIOI_EIMASTE_OTHERS,$PAGE); } //[%POIOI_EIMASTE_CONTENT_V2%] $POIOI_EIMASTE_CONTENT_V2=""; $POIOI_EIMASTE_V2=""; if(strstr($PAGE,"[%POIOI_EIMASTE_CONTENT_V2%]")) { $img = getRelatedAttachments($ar->art_id); $POIOI_EIMASTE_V2='
    '.$img[1]->ltitle.'
    '.$ar->title.'
    '.$ar->shortdesc.'
    '; $POIOI_EIMASTE_CONTENT_V2='
    '.$ar->fulltxt.'
    '; $PAGE=str_replace("[%POIOI_EIMASTE_CONTENT_V2%]",$POIOI_EIMASTE_CONTENT_V2,$PAGE); $PAGE=str_replace("[%POIOI_EIMASTE_V2%]",$POIOI_EIMASTE_V2,$PAGE); } //[%HEADER_SUPPORT%] $HEADER_SUPPORT=""; if(strstr($PAGE,"[%HEADER_SUPPORT%]")) { // if($tempr->temp_id==14 || $tempr->temp_id==15 || $tempr->temp_id==8 || $tempr->temp_id==11){ $ac = new ArticleList(); $ac->full_info=true; $ac->only_active_today=true; $ac->by_status=3; $ac->status_comp="="; if(($tempr->temp_id==8 && $art_count>1) || $tempr->temp_id==12 ) { $child = $cm->getSubNodes($sel,1); $desc = new ArticleDBRecord($dbconn); $desc->getFirstOfNode($child[0]->cat_id, $loc_iso); $descr_id = $desc->art_id; } else $descr_id = $al->list[0]->art_id; $ac->sort_order="rel_order ASC"; $ac->getRelatedArticles($dbconn,$descr_id,1,1,'top'); if(count($ac->list)>0){ $HEADER_SUPPORT='
    temp_id==12)?' style="margin-right:0 !important;width:auto !important;"':'').'>
    '.($sel==$HOMEPAGENODEID ?$PHRASE_SUPPORT_HOME[$loc_iso]:$PHRASE_SUPPORT_ROS[$loc_iso]).'
      temp_id==12)?' style="width:auto !important;"':'').'>'; $ttl=count($ac->list)>6?6:count($ac->list); for($i=0;$i<$ttl;$i++){ $img = getRelatedAttachments($ac->list[$i]->art_id); preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+(?=\?)|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $img[1]->embed, $matches); if($img[1]->embed!='') { $href1=''; $href2=''; } else if($ac->list[$i]->shortdesc!=''){ $href1=''; $href2=''; } $HEADER_SUPPORT.='
    • 1?'class="li_'.($i+1).'th"':'').'>'.$href1.''.$img[0]->ltitle.''.$href2.'
    • '; } $HEADER_SUPPORT.='
    '; } $HEADER_SUPPORT2='
    '; $LOGO=''; if($sel!=$HOMEPAGENODEID) { $HEADER_SUPPORT=""; } if($sel==$HOMEPAGENODEID || $tempr->temp_id==12) $PAGE=str_replace("[%HEADER_SUPPORT%]",$HEADER_SUPPORT.'
    '.$LOGO.$HEADER_SUPPORT2,$PAGE); //else if($tempr->temp_id==12) $PAGE=str_replace("[%HEADER_SUPPORT%]",$LOGO.$HEADER_SUPPORT2,$PAGE); else $PAGE=str_replace("[%HEADER_SUPPORT%]",$LOGO.$HEADER_SUPPORT,$PAGE); } //[%SECOND_PAGE_CONTENT%] $SECOND_PAGE_CONTENT=""; if(strstr($PAGE,"[%SECOND_PAGE_CONTENT%]")) { $img = getRelatedAttachments($ar->art_id); $file = getRelatedAttachments($ar->art_id,3); //'.showYTvid($img[2]->embed).'rel="shadowbox;player=iframe;height='.($img[2]->height==0?$DEFAULTYTHEIGHT:$img[2]->height).';width='.($img[2]->width==0?$DEFAULTYTWIDTH:$img[2]->width).'" preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+(?=\?)|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $img[2]->embed, $matches); $SECOND_PAGE_CONTENT='
    '.$ar->title.'

    '.$ar->fulltxt.'

    '; /********** [%CHAT_LINK%] ************/ $lnk = new ArticleDBRecord($dbconn); $lnk->getFirstOfNode($path[1]->cat_id); $CHAT_LINK=''.$path[1]->name.' και Αυτοεκτίμηση Community Conversations'; /********** [%SURVEY_LINK%] / used to dl videos ************/ $SURVEY_LINK=''; // if($ar->shortdesc!='') $SURVEY_LINK='Η ΓΝΩΜΗ ΣΟΥ ΜΕΤΡΑΕΙ! ΠΑΡΕ ΜΕΡΟΣ ΣΤΗΝ ΕΡΕΥΝΑ'; /* if($file[0]->URI!=''){ if($_SESSION['usr_mail_given']) $js = "download_image();"; else $js = "$('#dl_pop_up').toggle();"; $SURVEY_LINK='ΚΑΤΕΒΑΣΕ ΕΔΩ ΟΛΑ
    ΤΑ ΣΧΕΤΙΚΑ VIDEO
    '; $SURVEY_LINK.=''; } */ /********** [%OTHER_CATEGORIES%] ************/ $oc = $cm->getSubNodes($path[1]->cat_id, 1); for($i=0;$icat_id) continue; $att=new AttachmentList(); $att->populateCategPhotos($dbconn,$oc[$i]->cat_id,$_SESSION["ses_locale"],$ATTYPE_MEDIA,1,1); $OTHER_CATEGORIES.='
  • '.$oc[$i]->name.'
  • '; } /********** [%SIDE_SUPPORT%] ************/ $ss = new ArticleList(); $ss->full_info=true; $ss->only_active_today=true; $ss->by_status=3; $ss->status_comp="="; $ss->getRelatedArticles($dbconn,$ar->art_id,1,1,'side'); if(count($ss->list)>0){ $SIDE_SUPPORT=''; } /********** [%REL_ARTS_LINK%] ************/ $child = $cm->getSubNodes($sel, 1); $REL_ARTS_LINK = buildlink("c", $child[0]); $PAGE=str_replace("[%SECOND_PAGE_CONTENT%]",$SECOND_PAGE_CONTENT,$PAGE); $PAGE=str_replace("[%CHAT_LINK%]",$CHAT_LINK,$PAGE); $PAGE=str_replace("[%SURVEY_LINK%]",$SURVEY_LINK,$PAGE); $PAGE=str_replace("[%CATEGORY_TITLE%]",strip_tags($path[1]->name),$PAGE); $PAGE=str_replace("[%OTHER_CATEGORIES%]",$OTHER_CATEGORIES,$PAGE); $PAGE=str_replace("[%REL_ARTS_LINK%]",$REL_ARTS_LINK,$PAGE); $PAGE=str_replace("[%SIDE_SUPPORT%]",$SIDE_SUPPORT,$PAGE); } /********** [%FOOTER_SUPPORT%] ************/ $FOOTER_SUPPORT=""; if(strstr($PAGE,"[%FOOTER_SUPPORT%]")) { $fc = new ArticleList(); $fc->full_info=true; $fc->only_active_today=true; $fc->by_status=3; $fc->status_comp="="; if($tempr->temp_id==12 && $art_count>1) { $child = $cm->getSubNodes($sel,1); $desc = new ArticleDBRecord($dbconn); $desc->getFirstOfNode($child[0]->cat_id, $loc_iso); $descr_id = $desc->art_id; $div_hder='
    '.$PHRASE_SUPPORT_HOME[$loc_iso].'
    '; } else { $descr_id=$ar->art_id; $div_hder='
    '.$PHRASE_SUPPORT_ROS[$loc_iso].'
    '; } $fc->getRelatedArticles($dbconn,$descr_id,1,1,'bottom'); if(count($fc->list)>0){ $FOOTER_SUPPORT='
    '.$div_hder; $FOOTER_SUPPORT.='
      '; $ttl=count($fc->list)>6?6:count($fc->list); for($i=0;$i<$ttl;$i++){ $img = getRelatedAttachments($fc->list[$i]->art_id); if($img[1]->embed!=''){ $href1=''; $href2=''; } else if($fc->list[$i]->shortdesc!=''){ $href1=''; $href2=''; } $FOOTER_SUPPORT.='
    • '.$href1.''.$img[0]->ltitle.''.$href2.'
    • '; } $FOOTER_SUPPORT.='
    '; } $FOOTER_SUPPORT=""; $PAGE=str_replace("[%FOOTER_SUPPORT%]",$FOOTER_SUPPORT,$PAGE); } //[%REST_VIDEOS%] $REST_VIDEOS=""; if(strstr($PAGE,"[%REST_VIDEOS%]")) { $svd = new ArticleList(); $svd->status_comp="="; $svd->by_status="3"; $svd->full_info=true; $svd->only_active_today=true; $svd->sort_order="a.art_order"; $svd->sorting="DESC"; $svd->getArticlesOfNode($dbconn, $sel, 1, 1, 0, 999); for($i=0;$ilist);$i++){ if($svd->list[$i]->art_id != $ar->art_id){ $img = getRelatedAttachments($svd->list[$i]->art_id); $REST_VIDEOS.='
  • list[$i]).'">'.$svd->list[$i]->title.''.$svd->list[$i]->menu_title.'
  • '; } else $curr_video = $i+1; } $PAGE=str_replace("[%REST_VIDEOS%]",$REST_VIDEOS,$PAGE); } //[%CONTENT%] $CONTENT=""; if(strstr($PAGE,"[%CONTENT%]")) { $CONTENT="

    ".$al->list[0]->title."

    ".($sel == $SITEMAPNODEID ? "[%SITE_MAP%]" : "

    ".$al->list[0]->fulltxt."

    "); $PAGE=str_replace("[%CONTENT%]",$CONTENT,$PAGE); } //[%BREAD_CRUMP%] $BREAD_CRUMP=""; if(strstr($PAGE,"[%BREAD_CRUMP%]")) { $BREAD_CRUMP.="Αρχική"; if($path[2]->parent_id!='')$BREAD_CRUMP.=" | getObject($cm->getParent($sel),$loc_iso))."\">".strip_tags($cm->getName($cm->getParent($sel))).""; $BREAD_CRUMP.=" | getObject($sel),$loc_iso)."\">".strip_tags($cm->getName($sel)).""; $PAGE=str_replace("[%BREAD_CRUMP%]",$BREAD_CRUMP,$PAGE); } // [%CHAT_UPPER%] $CHAT_UPPER=""; if(strstr($PAGE,"[%CHAT_UPPER%]")) { $hv = getRelatedAttachments($ar->art_id); $CHAT_UPPER='

    '.$ar->title.'

    '.$path[1]->name.' και αυτοεκτίμηση

     
    '.$ar->fulltxt.'
    '; $PAGE=str_replace("[%CHAT_UPPER%]",$CHAT_UPPER,$PAGE); } // [%REL_ARTS_CONTENT%] $REL_ARTS_CONTENT=""; if(strstr($PAGE,"[%REL_ARTS_CONTENT%]")) { if(count($al->list)>1){ for($i=0;$ilist);$i++){ $REL_ARTS_CONTENT.="

    ".$al->list[$i]->title."

    ".$al->list[$i]->title."

    ".getSummary($al->list[$i],650)."

    "; } $REL_ARTS_CONTENT.="
    ".$PHRASE_BACK_TO_REL[$loc_iso].""; } else{ $im = getRelatedAttachments($ar->art_id); $ntx = new ArticleDBRecord($dbconn); $ntx->getNextOf($ar->art_id, $sel, 1, "art_order DESC"); $prv = new ArticleDBRecord($dbconn); $prv->getPrevOf($ar->art_id, $sel, 1, "art_order DESC"); $REL_ARTS_CONTENT='
    '; //
    '; if($im[0]->URI!='') $REL_ARTS_CONTENT.='
    '.$im[0]->ltitle.'
    '; $REL_ARTS_CONTENT.='
    '.$ar->title.'

    '.$ar->fulltxt.'

    '.($prv->art_id!=''?'prev':'').($ntx->art_id!=''?'next':'').'
    '; // file attachments $file = getRelatedAttachments($ar->art_id,3); if($file[0]->URI!=''){ $REL_ARTS_CONTENT.=''; } $rla = new ArticleList(); $rla->status_comp="="; $rla->by_status="3"; $rla->full_info=true; $rla->only_active_today=true; $rla->sort_order="a.art_order"; $rla->sorting="DESC"; $rla->getArticlesOfNode($dbconn, $sel, 1, 1, 0, 999, $ar->art_id); if(count($rla->list)>0){ $REL_ARTS_CONTENT.='
    Διαβάστε Σχετικά Άρθρα - '.$path[2]->name.'
    '; } } $PAGE=str_replace("[%REL_ARTS_CONTENT%]",$REL_ARTS_CONTENT,$PAGE); } // [%SITE_MAP%] $SITE_MAP=""; if(strstr($PAGE,"[%SITE_MAP%]")) { $SITE_MAP="

    ".$cm->getName($HOMEPAGENODEID)."

    "; $subs1=$cm->getSubNodes($MAINMENUNODEID,1); $sub1count=count($subs1); for($i=0; $i<$sub1count; $i++) { if($cm->getName($subs1[$i]->cat_id)=='description') continue; $sm = new ArticleList(); $sm->only_active_today=true; $sm->by_status=3; $sm->status_comp="="; $sm->by_locale=$_SESSION['ses_locale']; $sm->getArticlesOfNode($dbconn, $subs1[$i]->cat_id, 1, 1); if(count($sm->list)==1){ $SITE_MAP.="

    list[0],$loc_iso)."\">".$cm->getName($subs1[$i]->cat_id)."

    "; } else if(count($sm->list)>1){ $SITE_MAP.="

    ".$cm->getName($subs1[$i]->cat_id)."

    "; for($j=0; $jlist); $j++) { $SITE_MAP.= "

    list[$j],$loc_iso)."\">".$sm->list[$j]->title."

    "; } } else { $SITE_MAP.="

    ".$cm->getName($subs1[$i]->cat_id)."

    "; } $subs2=$cm->getSubNodes($subs1[$i]->cat_id,1); $sub2count=count($subs2); if($sub2count>0){ for($j=0; $j<$sub2count; $j++) { if($cm->getName($subs2[$j]->cat_id)=='description') continue; $sm2 = new ArticleList(); $sm2->by_status=3; $sm2->status_comp="="; $sm2->by_locale=$_SESSION['ses_locale']; $sm2->getArticlesOfNode($dbconn, $subs2[$j]->cat_id, 1, 1,0,9999,"",0,$loc_iso); if(count($sm2->list)==1){ $SITE_MAP.="
    list[0],$loc_iso)."\">".$cm->getName($subs2[$j]->cat_id)."
    "; } else if(count($sm2->list)>1){ $SITE_MAP.="
    ".$cm->getName($subs2[$j]->cat_id)."
    "; for($k=0; $klist); $k++) { $SITE_MAP.= "

    list[$k],$loc_iso)."\">".$sm2->list[$k]->title."

    "; } } else { $SITE_MAP.="
    ".$cm->getName($subs2[$j]->cat_id)."
    "; } $subs3=$cm->getSubNodes($subs2[$j]->cat_id,1); $sub3count=count($subs3); if($sub3count>0){ for($k=0; $k<$sub3count; $k++) { if($cm->getName($subs3[$k]->cat_id)=='description') continue; $sm3 = new ArticleList(); $sm3->by_status=3; $sm3->status_comp="="; $sm3->by_locale=$_SESSION['ses_locale']; $sm3->getArticlesOfNode($dbconn, $subs3[$k]->cat_id, 1, 1,0,9999,"",0,$loc_iso); if(count($sm3->list)==1){ $SITE_MAP.="
    list[0],$loc_iso)."\">".$cm->getName($subs3[$k]->cat_id)."
    "; } else if(count($sm3->list)>1){ $SITE_MAP.="
    ".$cm->getName($subs3[$k]->cat_id)."
    "; for($l=0; $llist); $l++) { $SITE_MAP.= "

    list[$l],$loc_iso)."\">".$sm3->list[$l]->title."

    "; } } else { $SITE_MAP.="
    ".$cm->getName($subs3[$k]->cat_id)."
    "; } } } } } } $PAGE=str_replace("[%SITE_MAP%]",$SITE_MAP,$PAGE); } // POP_UP $POP_UP="

    SIGN IN

    Συμπληρώστε το email σας, για να σας κατεβάσετε όλα τα σχετικά ".($tempr->temp_id==8?"άρθρα":"video")." της κατηγορίας.

    SIGN IN
    Δέχομαι να μου στέλνετε ενημερωτικό υλικό.
    "; $PAGE=str_replace("[%POP_UP%]",$POP_UP,$PAGE); //[%LOGO%] $PAGE=str_replace("[%LOGO%]",($path[1]->cat_id==$CHATNODEID?"logo_sec_chat.png":"logo.png"),$PAGE); //[%CANONICAL_URL%] $PAGE=str_replace("[%CANONICAL_URL%]",getCanonicalURL(),$PAGE); //[%PHRASE_FRIDAY_LINK%] $PAGE=str_replace("[%PHRASE_FRIDAY_LINK%]",$PHRASE_FRIDAY_LINK['el'],$PAGE); //[%PHRASE_BANNER_LINK%] $PAGE=str_replace("[%PHRASE_BANNER_LINK%]",$PHRASE_BANNER_LINK['el'],$PAGE); // [%BU%] $PAGE=str_replace("[%BU%]",$BASE_URL."site/",$PAGE); //[%NODE_NAME%] $PAGE=str_replace("[%NODE_NAME%]",$cm->getName($sel)." (video ".$curr_video."/".count($svd->list).")",$PAGE); // [%HOME%] $PAGE=str_replace("[%HOME%]",buildlink('c',$cm->getObject($HOMEPAGENODEID)),$PAGE); // [%SEARCHNODEID%] $PAGE=str_replace("[%SEARCHNODEID%]",buildlink('c',$cm->getObject($SEARCHNODEID)),$PAGE); preg_match_all("/PHRASE_[A-Za-z0-9_]+/",$PAGE,$matches); $words=$matches[0]; foreach ($words as $word) { $PAGE=str_replace("[%@".$word."@%]",${$word}[$loc_iso],$PAGE); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// functions ////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Remarks: returns an attachment array function getRelatedAttachments($aid,$media_type=""){ global $dbconn,$ATTYPE_MEDIA,$IN_MEDIA_URL; if ($media_type=="") $media_type=$ATTYPE_MEDIA; $rml=new AttachmentList(); $rml->by_locale=$_SESSION["ses_locale"]; if($aid>0) $rml->getRelatedAtt($dbconn,$aid,$media_type,1,1); return $rml->list; } function getSEOURL($s) { $arr=explode("/",$s); $l=count($arr); if($l>0) { if($arr[$l-1]=="index") return array("type"=>"c","seourl"=>$arr[$l-2]); else return array("type"=>"a","seourl"=>$arr[$l-1]); } return null; } function get_include_contents($filename) { global $al,$dbconn; if (is_file($filename)) { ob_start(); include $filename; $contents = ob_get_contents(); ob_end_clean(); return $contents; } return false; } //this is a recursive function !!! function includeTemplates($tempid,$array,$html){ global $dbconn; $ids = array(); $tags = array(); //search tags in html and add their ids in array $ids for($i = 0; $i < count($array); ++$i){ $tag2search = "[%#".$array[$i]->title."#%]"; if(strstr($html,$tag2search)!==FALSE){ $ids[count($ids)] = $array[$i]->temp_id; $tags[count($tags)] = $tag2search; } }//for //for each id get its html - replace it in the parent html and call function for($j = 0; $j < count($ids); ++$j){ $tempr=new TemplateDBRecord($dbconn); $tempr->temp_id=$ids[$j]; $tempr->get(); $html = str_replace($tags[$j],$tempr->html,$html); //call fuction $html=includeTemplates($ids[$j],$array,$html); }//for return $html; }//function function getXtraValue($extid,$xtype) { global $extras_array; for($i=0; $iext_id=$_extras_array[$num]["ext_id"]; $ext->get(); $xnames=unserialize($ext->name); return $xnames[$loc]; } function in_path($parr,$id) { $l=count($parr); $i=0; while($i<$l) if($parr[$i++]->cat_id==$id) return true; return false; } function getThumb($aid,$prefwidth=238) { global $dbconn,$ATTYPE_MEDIA,$IN_MEDIA_URL; /* if($aid>0){ $art=new ArticleDBRecord($dbconn); $art->art_id=$aid; $art->get(); }*/ $rml=new AttachmentList(); $rml->by_locale=$_SESSION["ses_locale"]; if($aid>0) $rml->getRelatedAtt($dbconn,$aid,$ATTYPE_MEDIA,1,1); // if($aid>0) $rml->getRelatedAtt($dbconn,$art->inherit_rel?$art->trans_id:$art->art_id,$ATTYPE_MEDIA,1,1); $img=""; for($ii=0; $iilist); $ii++) { if($rml->list[$ii]->URI2!="" && $prefwidth<=143 && $img=="") $img=decideSource($IN_MEDIA_URL,$rml->list[$ii]->URI2); //else if($rml->list[$ii]->URI3!="" && $prefwidth==106) $img=decideSource($IN_MEDIA_URL,$rml->list[$ii]->URI3); } if($img=="" && $rml->list[0]->URI!="") $img=decideSource($IN_MEDIA_URL,$rml->list[0]->URI); return $img; } function getRelatedImage($aid) { global $dbconn,$ATTYPE_MEDIA,$IN_MEDIA_URL; $rml=new AttachmentList(); $rml->by_locale=$_SESSION["ses_locale"]; if($aid>0) $rml->getRelatedAtt($dbconn,$aid,$ATTYPE_MEDIA,1,1); $img=""; for($ii=0; $iilist); $ii++) { if($rml->list[$ii]->URI!="" /*&& $rml->list[$ii]->width<400*/) $img=decideSource($IN_MEDIA_URL,$rml->list[$ii]->URI); } return $img; } function getSummary($ar,$len=100) { return (strlen($ar->shortdesc)>=10)?cutatword(strip_tags($ar->shortdesc),$len):cutatword(strip_tags($ar->fulltxt),$len); } function getKeywordArray($artid) { global $dbconn; $rkl=new KeywordsList(); $rkl->ofArticle($dbconn,$artid); $total_relkey=count($rkl->list); $k=array(); for($j=0; $j<$total_relkey; $j++) $k[count($k)]=$rkl->list[$j]->keyword; return $k; } function fget_contents($f) { $fd = fopen ($f, "r"); $buffer=""; while (!feof ($fd)) { $buffer .= fgets($fd, 4096); } fclose ($fd); return $buffer; } function to_upper($str) { $keywords=array("α"=>"A","π"=>"Π","ά"=>"Α","β"=>"Β","γ"=>"Γ","δ"=>"Δ","ε"=>"Ε","έ"=>"Ε","ζ"=>"Ζ","η"=>"Η","ή"=>"Η","θ"=>"Θ","ι"=>"Ι","ί"=>"Ι","ϊ"=>"Ι","ΐ"=>"Ι","κ"=>"Κ","λ"=>"Λ","μ"=>"Μ","ν"=>"Ν","ξ"=>"Ξ","ο"=>"Ο","ό"=>"Ο","π"=>"Π","ρ"=>"Ρ","σ"=>"Σ","ς"=>"Σ","τ"=>"Τ","υ"=>"Υ","ύ"=>"Υ","ϋ"=>"Υ","ΰ"=>"Υ","φ"=>"Φ","χ"=>"Χ","ψ"=>"Ψ","ω"=>"Ω","ώ"=>"Ω", "α"=>"A","π"=>"Π","β"=>"Β","γ"=>"Γ","δ"=>"Δ","ε"=>"Ε","ζ"=>"Ζ","η"=>"Η","θ"=>"Θ","ι"=>"Ι","κ"=>"Κ","λ"=>"Λ","μ"=>"Μ","ν"=>"Ν","ξ"=>"Ξ","ο"=>"Ο","ρ"=>"Ρ","σ"=>"Σ","ς"=>"Σ","τ"=>"Τ","υ"=>"Y","φ"=>"Φ","χ"=>"Χ","ψ"=>"Ψ","ω"=>"Ω", "Α"=>"A","Β"=>"Β","Γ"=>"Γ","Δ"=>"Δ","Ε"=>"Ε","Ζ"=>"Ζ","Η"=>"Η","Θ"=>"Θ","Ι"=>"Ι","Κ"=>"Κ","Λ"=>"Λ","Μ"=>"Μ","Ν"=>"Ν","Ξ"=>"Ξ","Ο"=>"Ο","Ρ"=>"Ρ","Σ"=>"Σ","&Sigmaf;"=>"Σ","Τ"=>"Τ","Υ"=>"Y","Φ"=>"Φ","Χ"=>"Χ","Ψ"=>"Ψ","Ω"=>"Ω"); foreach($keywords as $k=>$v) $str=str_replace($k,$v,$str); $str=mb_strtoupper($str); return $str; } function clean1stcomma($str) { $ret=trim($str); if(substr($ret,0,1)==",") $ret=substr($ret,1); return $ret; } function decideCacheFilename() { global $artid,$sel; $ret=""; $_a=$artid; $_s=$sel; if($_a>0 && $_s>0) $ret="artid_".$_a."_sel_".$_s.".html"; else if($_a>0) $ret="artid_".$_a.".html"; else if($_s>0) $ret="sel_".$_s.".html"; return $ret; } function getCanonicalURL_old() { global $BASE_URL,$sel,$artid; $params=array(); if(isset($_REQUEST["query"])) $params["query"]=$_REQUEST["query"]; if(isset($_REQUEST["start"])) $params["start"]=$_REQUEST["start"]; if(isset($_REQUEST["slideshow"])) $params["slideshow"]=$_REQUEST["slideshow"]; if(isset($_REQUEST["trailer"])) $params["trailer"]=$_REQUEST["trailer"]; $ret=$BASE_URL."site/content.php?"; if($artid>0) $ret.="artid=".$artid; else $ret.="sel=".$sel; foreach($params as $n=>$v) $ret.="&".$n."=".$v; return $ret; } function getCanonicalURL() { global $BASE_URL,$sel,$artid,$al,$nr; if(isset($_REQUEST["query"])) $ret=$BASE_URL."site/content.php?query=".$_REQUEST["query"]; else { if($artid>0) { $ar=$al->list[0]; $ret=buildlink("a",$ar); } else { $ret=buildlink("c",$nr); } if(isset($_REQUEST["start"])) $ret.=",".$_REQUEST["start"]; } return $ret; } function print_tree($cid) { global $cm,$path,$sel,$locl; $ret=""; $subs=$cm->getSubNodes($cid,1); $c=count($subs); if($c>0) $ret.="
      \n"; for($i=0; $i<$c; $i++) { if(in_path($path,$subs[$i]->cat_id)) { if($subs[$i]->cat_id==$sel) $clas=" class=\"active selected\""; else $clas=" class=\"active\""; } else $clas=""; $ret.="".$subs[$i]->name.""; if($clas!="") $ret.=print_tree($subs[$i]->cat_id); $ret.="\n"; } if($c>0) $ret.="
    \n"; return $ret; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////// final output!///////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// echo $PAGE; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // put into cache if($docache) { $_cf=decideCacheFilename(); if($_cf!="") file_put_contents($_CACHE_DIR.$_cf,$PAGE); } ?>