PageRenderTime 56ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 1ms

/templates/n3u/header.php

https://github.com/n3u/n3u-Niche-Store
PHP | 469 lines | 431 code | 3 blank | 35 comment | 61 complexity | e33ce72afea6029caa948a0ad705de81 MD5 | raw file
  1. <?php
  2. /**
  3. n3u Niche Store - Custom Niche PHP Script
  4. Copyright (C) 2012-2014 n3u.com
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>
  15. **/
  16. if(!defined('n3u')){die('Direct access is not permitted.');} // Is n3u defined?
  17. function n3u_Menu(){
  18. global $n3u_configVars;
  19. global $n3u_lang;
  20. $n3u_customPages = n3u_CustomPages(); // Get array of custom pages
  21. echo "\t\t\t\t\t" . '<div class="TopBar">' . PHP_EOL
  22. . "\t\t\t\t\t\t" . '<nav>' . PHP_EOL
  23. . "\t\t\t\t\t\t\t" . '<ul>' . PHP_EOL
  24. // . "\t\t\t\t\t\t\t\t" . '<li><a href="./" id="MenuHome" target="_self" title="' . $n3u_lang['Home'] . '" type="text/html">' . $n3u_lang['Home'] . '</a></li>' . PHP_EOL
  25. . "\t\t\t\t\t\t\t\t" . '<li>' . PHP_EOL
  26. . "\t\t\t\t\t\t\t\t\t" . '<a href="./" target="_self" tabindex="1" title="' . n3u_TitleCleaner($n3u_configVars['SiteName']) . '">' . $n3u_configVars['SiteName'] . '</a>' . PHP_EOL
  27. . "\t\t\t\t\t\t\t\t\t" . '<ul>' . PHP_EOL;
  28. foreach($n3u_customPages as $n3u_customPage){
  29. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="'.$n3u_customPage['url'].'" target="_self" title="' . n3u_TitleCleaner($n3u_customPage['name']) . '" type="text/html">' . $n3u_customPage['name'] . '</a></li>' . PHP_EOL;
  30. }
  31. if($n3u_configVars['CleanUrls'] == TRUE){
  32. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="privacy.htm" target="_self" title="' . n3u_TitleCleaner($n3u_lang['PrivacyPolicy']) . '" type="text/html">' . $n3u_lang['PrivacyPolicy'] . '</a></li>' . PHP_EOL
  33. . "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="terms.htm" target="_self" title="' . n3u_TitleCleaner($n3u_lang['TermsConditions']) . '" type="text/html">' . $n3u_lang['TermsConditions'] . '</a></li>' . PHP_EOL
  34. . "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="contact.htm" target="_self" title="' . n3u_TitleCleaner($n3u_lang['Contact']) . '" type="text/html">' . $n3u_lang['Contact'] . '</a></li>' . PHP_EOL;
  35. }else{
  36. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="' . filter_var($n3u_configVars['self'] . '?x=privacy', FILTER_SANITIZE_URL) . '" target="_self" title="' . n3u_TitleCleaner($n3u_lang['PrivacyPolicy']) . '" type="text/html">' . $n3u_lang['PrivacyPolicy'] . '</a></li>' . PHP_EOL
  37. . "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="' . filter_var($n3u_configVars['self'] . '?x=terms', FILTER_SANITIZE_URL) . '" target="_self" title="' . n3u_TitleCleaner($n3u_lang['TermsConditions']) . '" type="text/html">' . $n3u_lang['TermsConditions'] . '</a></li>' . PHP_EOL
  38. . "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="' . filter_var($n3u_configVars['self'] . '?x=contact', FILTER_SANITIZE_URL) . '" target="_self" title="' . n3u_TitleCleaner($n3u_lang['Contact']) . '" type="text/html">' . $n3u_lang['Contact'] . '</a></li>' . PHP_EOL;
  39. }
  40. echo "\t\t\t\t\t\t\t\t\t" . '</ul>' . PHP_EOL
  41. . "\t\t\t\t\t\t\t\t" . '</li>' . PHP_EOL
  42. . "\t\t\t\t\t\t\t\t" . '<li>' . PHP_EOL;
  43. if($n3u_configVars['CleanUrls'] == TRUE){
  44. echo "\t\t\t\t\t\t\t\t\t" . '<a href="'.filter_var('search___'. urlencode($n3u_configVars['defaultKeyword']) . '-REL-1.htm', FILTER_SANITIZE_URL).'" tabindex="2" title="Categories">' . $n3u_lang['Categories'] . '</a>' . PHP_EOL;
  45. }else{
  46. echo "\t\t\t\t\t\t\t\t\t" . '<a href="' . filter_var($n3u_configVars['self'] . '?x=search&amp;m=&amp;b=&amp;q='. urlencode($n3u_configVars['defaultKeyword']), FILTER_SANITIZE_URL) . '" tabindex="2" title="Categories">' . $n3u_lang['Categories'] . '</a>' . PHP_EOL;
  47. }
  48. echo "\t\t\t\t\t\t\t\t\t" . '<ul>' . PHP_EOL;
  49. $n3u_configVars['CategoriesList'] = explode(',', str_replace(', ',',',$n3u_configVars['Categories']));
  50. if($n3u_configVars['CleanUrls'] == TRUE){
  51. foreach($n3u_configVars['CategoriesList'] as $n3u_Category){
  52. $n3u_category_url = filter_var('search___'. urlencode($n3u_configVars['defaultKeyword'] . ' ' . $n3u_Category) . '-REL-1.htm', FILTER_SANITIZE_URL); // &b=&m=&q=&price_min=&price_max=&sort=&p=
  53. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="' . $n3u_category_url . '" title="' . n3u_TitleCleaner($n3u_Category). '">' . $n3u_Category . '</a></li>' . PHP_EOL;
  54. }
  55. }else{
  56. foreach($n3u_configVars['CategoriesList'] as $n3u_Category){
  57. $n3u_category_url = filter_var($n3u_configVars['self'] . '?x=search&amp;m=&amp;b=&amp;q='. urlencode($n3u_configVars['defaultKeyword'] . ' ' . $n3u_Category), FILTER_SANITIZE_URL) .'&amp;sort=&amp;p=1';
  58. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a href="' . $n3u_category_url . '" title="' . n3u_TitleCleaner($n3u_Category). '">' . $n3u_Category . '</a></li>' . PHP_EOL;
  59. }
  60. }
  61. echo "\t\t\t\t\t\t\t\t\t" . '</ul>' . PHP_EOL
  62. . "\t\t\t\t\t\t\t\t" . '</li>' . PHP_EOL; // Categories
  63. // . "\t\t\t\t\t\t\t\t" . '<li><a title="Browse by...">Browse by...</a></li>' . PHP_EOL // Categories
  64. if(defined('admin')){
  65. echo "\t\t\t\t\t\t\t\t" . '<li>' . PHP_EOL;
  66. if($n3u_configVars['CleanUrls'] == TRUE){
  67. echo "\t\t\t\t\t\t\t\t\t" . '<a href="admin.htm" title="' . n3u_TitleCleaner($n3u_lang['Administration']) . '">' . $n3u_lang['Administration'] . '</a>' . PHP_EOL;
  68. }else{
  69. echo "\t\t\t\t\t\t\t\t\t" . '<a href="index.php?x=admin" tabindex="3" title="' . n3u_TitleCleaner($n3u_lang['Administration']) . '">' . $n3u_lang['Administration'] . '</a>' . PHP_EOL;
  70. }
  71. echo "\t\t\t\t\t\t\t\t\t" . '<ul>' . PHP_EOL;
  72. $n3u_configVars['AdminCatList'] = array('blocks','cache','main','messages','pages','stats','templates');
  73. if($n3u_configVars['CleanUrls'] == TRUE){
  74. foreach($n3u_configVars['AdminCatList'] as $n3u_Category){
  75. $n3u_category_url = filter_var('admin_'. urlencode($n3u_Category) . '.htm', FILTER_SANITIZE_URL); // admin_main.htm
  76. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a class="link" href="' . $n3u_category_url . '" tabindex="3" title="' . n3u_TitleCleaner($n3u_Category). '">' . ucfirst($n3u_Category) . '</a></li>' . PHP_EOL;
  77. }
  78. }else{
  79. foreach($n3u_configVars['AdminCatList'] as $n3u_Category){
  80. $n3u_category_url = filter_var($n3u_configVars['self'] . '?x=admin&amp;page='. urlencode($n3u_Category), FILTER_SANITIZE_URL); // ?x=admin&page=main
  81. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a class="link" href="' . $n3u_category_url . '" tabindex="3" title="' . n3u_TitleCleaner($n3u_Category). '">' . ucfirst($n3u_Category) . '</a></li>' . PHP_EOL;
  82. }
  83. }
  84. echo "\t\t\t\t\t\t\t\t\t\t" . '<li><a class="link" href="'. $n3u_configVars['self'] .'?x=logout" title="' . n3u_TitleCleaner($n3u_lang['LogOut']) . '">' . $n3u_lang['LogOut'] . '</a></li>' . PHP_EOL
  85. . "\t\t\t\t\t\t\t\t\t\t" . '<li>' . PHP_EOL
  86. . "\t\t\t\t\t\t\t\t\t\t\t" . '<form id="menu_form" method="post" action="' . $n3u_configVars['self'] . '">' . PHP_EOL
  87. . "\t\t\t\t\t\t\t\t\t\t\t\t" . '<select name="ClearCache" onchange="this.form.submit()">' . PHP_EOL
  88. . "\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<option disabled selected>' . $n3u_lang['ClearCache_Options'] . '</option>' . PHP_EOL
  89. . "\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<option value="ClearCacheFiles">' . $n3u_lang['ClearCache_Files'] . '</option>' . PHP_EOL
  90. . "\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<option value="ClearAllImages">' . $n3u_lang['ClearCache_Imgs_All'] . '</option>' . PHP_EOL
  91. . "\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<option value="ClearLastAccessedImages">' . $n3u_lang['ClearCache_Imgs_Acc'] . '</option>' . PHP_EOL
  92. . "\t\t\t\t\t\t\t\t\t\t\t\t\t" . '<option value="ClearLastModifiedImages">' . $n3u_lang['ClearCache_Imgs_Mod'] . '</option>' . PHP_EOL
  93. . "\t\t\t\t\t\t\t\t\t\t\t\t" . '</select>' . PHP_EOL
  94. . "\t\t\t\t\t\t\t\t\t\t\t" . '</form>' . PHP_EOL
  95. . "\t\t\t\t\t\t\t\t\t\t" . '</li>' . PHP_EOL
  96. . "\t\t\t\t\t\t\t\t\t" . '</ul>' . PHP_EOL
  97. . "\t\t\t\t\t\t\t\t" . '</li>' . PHP_EOL;
  98. }
  99. echo "\t\t\t\t\t\t\t" . '</ul>' . PHP_EOL
  100. . "\t\t\t\t\t\t" . '</nav>' . PHP_EOL
  101. . "\t\t\t\t\t" . '</div>' . PHP_EOL;// div TopBar
  102. }
  103. switch($n3u_inputVars['x']){
  104. case "download":
  105. case "feed":
  106. case "go":
  107. // do nothing
  108. break;
  109. case "admin": // If Admin, do this
  110. echo '<!DOCTYPE html>' . PHP_EOL
  111. . '<html>' . PHP_EOL
  112. . "\t" . '<head>' . PHP_EOL
  113. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  114. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  115. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  116. . "\t\t" . '<meta name="description" content="This page controls all the main settings for n3u Niche Store as well as displays admin-based blocks.">' . PHP_EOL;
  117. if(isset($n3u_PostVars) && $n3u_PostVars != NULL){
  118. echo "\t\t" . '<meta http-equiv="refresh" content="0">' . PHP_EOL;
  119. }
  120. echo "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL
  121. . "\t\t" . '<title>' . $n3u_lang['Admin_Panel'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  122. n3u_CacheCSS();
  123. n3u_CacheJS();
  124. echo "\t" . '</head>' . PHP_EOL
  125. . "\t" . '<body>' . PHP_EOL
  126. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  127. . "\t\t\t" . '<div id="header">' . PHP_EOL
  128. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  129. n3u_Menu();
  130. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  131. n3u_Block('header');
  132. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  133. break;
  134. case "contact": // If contact, do this
  135. echo '<!DOCTYPE html>' . PHP_EOL
  136. . '<html>' . PHP_EOL
  137. . "\t" . '<head>' . PHP_EOL
  138. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  139. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  140. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  141. . "\t\t" . '<meta name="description" content="Need to contact ' . $n3u_configVars['SiteName'] . '? This page will allow you to do just that!">' . PHP_EOL
  142. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  143. . "\t\t" . '<script type="text/javascript">var RecaptchaOptions = {theme : \'blackglass\'}; </script>' . PHP_EOL
  144. . "\t\t" . '<title>' . $n3u_lang['Contact'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  145. if($n3u_configVars['CleanUrls'] == TRUE){
  146. echo "\t\t" . '<link rel="canonical" href="' . filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . str_replace('index.php','',$n3u_configVars['self']) .$n3u_inputVars['x'] . '.htm',FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  147. }else{
  148. echo "\t\t" . '<link rel="canonical" href="'. filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . $n3u_configVars['self'] . '?x='.$n3u_inputVars['x'],FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  149. }
  150. n3u_CacheCSS();
  151. n3u_CacheJS();
  152. echo "\t" . '</head>' . PHP_EOL
  153. . "\t" . '<body>' . PHP_EOL
  154. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  155. . "\t\t\t" . '<div id="header">' . PHP_EOL
  156. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  157. n3u_Menu();
  158. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  159. n3u_Block('header');
  160. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  161. break;
  162. case "error": // If error, do this
  163. echo '<!DOCTYPE html>' . PHP_EOL
  164. . '<html>' . PHP_EOL
  165. . "\t" . '<head>' . PHP_EOL
  166. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  167. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  168. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  169. . "\t\t" . '<meta name="description" content="Sorry, An error has occurred.">' . PHP_EOL
  170. . "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL;
  171. if($n3u_inputVars['q']){
  172. echo "\t\t" . '<title>' . $n3u_inputVars['q'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  173. }else{
  174. echo "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  175. }
  176. n3u_CacheCSS();
  177. n3u_CacheJS();
  178. echo "\t" . '</head>' . PHP_EOL
  179. . "\t" . '<body>' . PHP_EOL
  180. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  181. . "\t\t\t" . '<div id="header">' . PHP_EOL
  182. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  183. n3u_Menu();
  184. echo "\t\t\t\t" . '</div>' . PHP_EOL // div Top
  185. . "\t\t\t" . '</div>' . PHP_EOL; //div header
  186. break;
  187. case "index": // If index, do this
  188. n3u_FetchSearch($n3u_configVars['Prosperent_Endpoint']);
  189. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  190. header("HTTP/1.1 404 Not Found");
  191. }
  192. n3u_CacheBegin(); // Start Caching
  193. echo '<!DOCTYPE html>' . PHP_EOL
  194. . '<html>' . PHP_EOL
  195. . "\t" . '<head>' . PHP_EOL
  196. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  197. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  198. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  199. . "\t\t" . '<meta name="description" content="Thanks for visiting ' . $n3u_configVars['SiteName'] . ', Your one stop for anything relating to ' . $n3u_configVars['defaultKeyword'] . '. Please enjoy the website!">' . PHP_EOL;
  200. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  201. echo "\t\t" . '<meta name="robots" content="noindex">' . PHP_EOL;
  202. }else{
  203. echo "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL;
  204. }
  205. if($n3u_inputVars['q']){
  206. echo "\t\t" . '<title>' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  207. }else{
  208. echo "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  209. }
  210. n3u_CacheCSS();
  211. // echo "\t\t" . '<script type="text/javascript">' . PHP_EOL
  212. // . "\t\t\t" . '<!--' . PHP_EOL
  213. // . "\t\t\t\t" . 'prosperent_pa_uid = '.$n3u_configVars['Prosperent_UserID'].';' . PHP_EOL
  214. // . "\t\t\t\t" . 'prosperent_pa_fallback_query = \''.$n3u_configVars['defaultKeyword'].'\';' . PHP_EOL
  215. // . "\t\t\t\t" . 'prosperent_pa_fallback_query_is_default = 1;' . PHP_EOL
  216. // . "\t\t\t" . '//-->' . PHP_EOL
  217. // . "\t\t" . '</script>' . PHP_EOL;
  218. n3u_CacheJS();
  219. echo "\t" . '</head>' . PHP_EOL
  220. . "\t" . '<body>' . PHP_EOL
  221. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  222. . "\t\t\t" . '<div id="header">' . PHP_EOL
  223. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  224. n3u_Menu();
  225. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  226. n3u_Block('header');
  227. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  228. break;
  229. case "item": // If item, do this
  230. n3u_FetchItem($n3u_configVars['Prosperent_Endpoint']);
  231. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  232. header("HTTP/1.1 404 Not Found");
  233. }
  234. foreach($n3u_results as $n3u_result){
  235. // loop through, This is needed
  236. }
  237. echo '<!DOCTYPE html>' . PHP_EOL
  238. . '<html>' . PHP_EOL
  239. . "\t" . '<head>' . PHP_EOL
  240. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  241. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  242. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  243. . "\t\t" . '<meta name="description" content="' . substr(n3u_TitleCleaner(str_replace(array("\t\t\t\t\t\t",PHP_EOL),'',n3u_extract($n3u_result['description'],'2',FALSE))),0,160) . '">' . PHP_EOL;
  244. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  245. echo "\t\t" . '<meta name="robots" content="noindex">' . PHP_EOL;
  246. }else{
  247. echo "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL;
  248. }
  249. if(isset($n3u_result['keyword'])){
  250. echo "\t\t" . '<title>' . substr($n3u_result['keyword'],0,55) . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  251. }else{
  252. echo "\t\t" . '<title>' . substr($n3u_inputVars['q'],0,55) . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  253. }
  254. if($n3u_configVars['CleanUrls'] == TRUE){
  255. echo "\t\t" . '<link rel="canonical" href="' . filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . str_replace('index.php','',$n3u_configVars['self']) .$n3u_inputVars['x'] . '_'.$n3u_inputVars['item'].'.htm',FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  256. }else{
  257. echo "\t\t" . '<link rel="canonical" href="'. filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . $n3u_configVars['self'] . '?x=item&amp;item=' . $n3u_inputVars['item'],FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  258. }
  259. n3u_CacheCSS();
  260. // echo "\t\t" . '<script type="text/javascript">' . PHP_EOL
  261. // . "\t\t\t" . '<!--' . PHP_EOL
  262. // . "\t\t\t\t" . 'prosperent_pa_uid = '.$n3u_configVars['Prosperent_UserID'].';' . PHP_EOL
  263. // . "\t\t\t\t" . 'prosperent_pa_fallback_query = \''.$n3u_configVars['defaultKeyword'].'\';' . PHP_EOL
  264. // . "\t\t\t\t" . 'prosperent_pa_fallback_query_is_default = 1;' . PHP_EOL
  265. // . "\t\t\t" . '//-->' . PHP_EOL
  266. // . "\t\t" . '</script>' . PHP_EOL;
  267. n3u_CacheJS();
  268. echo "\t" . '</head>' . PHP_EOL
  269. . "\t" . '<body>' . PHP_EOL
  270. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  271. . "\t\t\t" . '<div id="header">' . PHP_EOL
  272. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  273. n3u_Menu();
  274. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  275. n3u_Block('header');
  276. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  277. break;
  278. case "login": // If login, do this
  279. echo '<!DOCTYPE html>' . PHP_EOL
  280. . '<html>' . PHP_EOL
  281. . "\t" . '<head>' . PHP_EOL
  282. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  283. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  284. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  285. . "\t\t" . '<meta name="description" content="You must first login. You may do so on this page.">' . PHP_EOL
  286. . "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL
  287. . "\t\t" . '<script type="text/javascript">var RecaptchaOptions = {theme : \'white\'}; </script>' . PHP_EOL
  288. . "\t\t" . '<title>' . $n3u_lang['Login'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  289. n3u_CacheCSS();
  290. n3u_CacheJS();
  291. echo "\t" . '</head>' . PHP_EOL
  292. . "\t" . '<body>' . PHP_EOL
  293. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  294. . "\t\t\t" . '<div id="header">' . PHP_EOL
  295. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  296. n3u_Menu();
  297. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  298. n3u_Block('header');
  299. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  300. break;
  301. case "logout": // If logout, do this
  302. echo '<!DOCTYPE html>' . PHP_EOL
  303. . '<html>' . PHP_EOL
  304. . "\t" . '<head>' . PHP_EOL
  305. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  306. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  307. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  308. . "\t\t" . '<meta name="description" content="You have been logged out.">' . PHP_EOL
  309. . "\t\t" . '<meta name="robots" content="noindex,nofollow">' . PHP_EOL
  310. . "\t\t" . '<title>' . $n3u_lang['LogOut'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  311. n3u_CacheCSS();
  312. n3u_CacheJS();
  313. echo "\t" . '</head>' . PHP_EOL
  314. . "\t" . '<body>' . PHP_EOL
  315. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  316. . "\t\t\t" . '<div id="header">' . PHP_EOL
  317. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  318. n3u_Menu();
  319. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  320. n3u_Block('header');
  321. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  322. break;
  323. case "privacy": // If Privacy, do this
  324. n3u_CacheBegin(); // Start Caching
  325. echo '<!DOCTYPE html>' . PHP_EOL
  326. . '<html>' . PHP_EOL
  327. . "\t" . '<head>' . PHP_EOL
  328. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  329. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  330. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  331. . "\t\t" . '<meta name="description" content="This is the Privacy Policy for ' . $n3u_configVars['SiteName'] . '. Please read over it carefully.">' . PHP_EOL
  332. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  333. . "\t\t" . '<title>' . $n3u_lang['PrivacyPolicy'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  334. if($n3u_configVars['CleanUrls'] == TRUE){
  335. echo "\t\t" . '<link rel="canonical" href="' . filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . str_replace('index.php','',$n3u_configVars['self']) .$n3u_inputVars['x'] . '.htm',FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  336. }else{
  337. echo "\t\t" . '<link rel="canonical" href="'. filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . $n3u_configVars['self'] . '?x='.$n3u_inputVars['x'],FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  338. }
  339. n3u_CacheCSS();
  340. n3u_CacheJS();
  341. echo "\t" . '</head>' . PHP_EOL
  342. . "\t" . '<body>' . PHP_EOL
  343. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  344. . "\t\t\t" . '<div id="header">' . PHP_EOL
  345. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  346. n3u_Menu();
  347. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  348. n3u_Block('header');
  349. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  350. break;
  351. case "search": // If Search, do this
  352. n3u_FetchSearch($n3u_configVars['Prosperent_Endpoint']);
  353. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  354. header("HTTP/1.1 404 Not Found");
  355. }
  356. n3u_CacheBegin(); // Start Caching
  357. echo '<!DOCTYPE html>' . PHP_EOL
  358. . '<html>' . PHP_EOL
  359. . "\t" . '<head>' . PHP_EOL
  360. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  361. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  362. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  363. . "\t\t" . '<meta name="description" content="Search Results for ' . @$n3u_inputVars['q']. '. Displaying page ' . $n3u_inputVars['p'] . '">' . PHP_EOL;
  364. if(!isset($n3u_results) || @$prosperentApi->gettotalRecordsFound() == NULL){
  365. echo "\t\t" . '<meta name="robots" content="noindex">' . PHP_EOL;
  366. }elseif($n3u_inputVars['sort'] != 'REL'){
  367. echo "\t\t" . '<meta name="robots" content="noindex,follow">' . PHP_EOL;
  368. }else{
  369. echo "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL;
  370. }
  371. if($n3u_configVars['CleanUrls'] == TRUE){
  372. echo "\t\t" . '<link rel="canonical" href="' . filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . str_replace('index.php','',$n3u_configVars['self']) .$n3u_inputVars['x'] . '_'.$n3u_inputVars['m'].'_'.$n3u_inputVars['b'].'_'.urlencode($n3u_inputVars['q']).'-REL-'.$n3u_inputVars['p'].'.htm',FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  373. }else{
  374. echo "\t\t" . '<link rel="canonical" href="'. filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . $n3u_configVars['self'] . '?x=' . $n3u_inputVars['x'] . '&amp;m=' . urlencode($n3u_inputVars['m']) . '&amp;b=' . urlencode($n3u_inputVars['b']) . '&amp;q=' . urlencode($n3u_inputVars['q']) . '&amp;sort=REL' . '&amp;p='.$n3u_inputVars['p'], FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  375. }
  376. echo "\t\t" . '<link rel="dns-prefetch" href="//prosperent.com">' . PHP_EOL;
  377. n3u_CacheCSS();
  378. if($n3u_configVars['CleanUrls'] == TRUE){
  379. if(isset($n3u_inputVars['q']) && $n3u_inputVars['q'] != $n3u_configVars['defaultKeyword']){
  380. echo "\t\t" . '<link href="feed_'.$n3u_inputVars['m'].'_'.$n3u_inputVars['b'].'_'.urlencode($n3u_inputVars['q']).'-REL-'.$n3u_inputVars['p'].'.xml" rel="alternate" title="' . str_replace($n3u_configVars['defaultKeyword'] .' ','',$n3u_inputVars['q']) . ' - ' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  381. }elseif($n3u_inputVars['q'] == $n3u_configVars['defaultKeyword']){
  382. echo "\t\t" . '<link href="feed_'.$n3u_inputVars['m'].'_'.$n3u_inputVars['b'].'_'.urlencode($n3u_inputVars['q']).'-REL-'.$n3u_inputVars['p'].'.xml" rel="alternate" title="' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  383. }else{
  384. echo "\t\t" . '<link href="feed_'.$n3u_inputVars['m'].'_'.$n3u_inputVars['b'].'_'.urlencode($n3u_inputVars['q']).'-REL-'.$n3u_inputVars['p'].'.xml" rel="alternate" title="' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  385. }
  386. }else{
  387. if(isset($n3u_inputVars['q']) && $n3u_inputVars['q'] != $n3u_configVars['defaultKeyword']){
  388. echo "\t\t" . '<link href="?x=feed' . '&amp;m=' . urlencode($n3u_inputVars['m']) . '&amp;b=' . urlencode($n3u_inputVars['b']) . '&amp;q=' . urlencode($n3u_inputVars['q']) . '&amp;sort=REL' . '&amp;p='.$n3u_inputVars['p'] . '" rel="alternate" title="' . str_replace($n3u_configVars['defaultKeyword'] .' ','',$n3u_inputVars['q']) . ' - ' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  389. }elseif($n3u_inputVars['q'] == $n3u_configVars['defaultKeyword']){
  390. echo "\t\t" . '<link href="?x=feed' . '&amp;m=' . urlencode($n3u_inputVars['m']) . '&amp;b=' . urlencode($n3u_inputVars['b']) . '&amp;q=' . urlencode($n3u_inputVars['q']) . '&amp;sort=REL' . '&amp;p='.$n3u_inputVars['p'] . '" rel="alternate" title="' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  391. }else{
  392. echo "\t\t" . '<link href="?x=feed' . '&amp;m=' . urlencode($n3u_inputVars['m']) . '&amp;b=' . urlencode($n3u_inputVars['b']) . '&amp;q=' . urlencode($n3u_inputVars['q']) . '&amp;sort=REL' . '&amp;p='.$n3u_inputVars['p'] . '" rel="alternate" title="' . $n3u_configVars['SiteName'] . '" type="application/atom+xml">' . PHP_EOL;
  393. }
  394. }
  395. if(isset($n3u_inputVars['q']) && $n3u_inputVars['q'] != $n3u_configVars['defaultKeyword']){
  396. echo "\t\t" . '<title>' . str_replace($n3u_configVars['defaultKeyword'] .' ','',substr($n3u_inputVars['q'],0,55)) . ' - ' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  397. }elseif($n3u_inputVars['q'] == $n3u_configVars['defaultKeyword']){
  398. echo "\t\t" . '<title>' . $n3u_configVars['defaultKeyword'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  399. }else{
  400. echo "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  401. }
  402. n3u_CacheJS();
  403. echo "\t" . '</head>' . PHP_EOL
  404. . "\t" . '<body>' . PHP_EOL
  405. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  406. . "\t\t\t" . '<div id="header">' . PHP_EOL
  407. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  408. n3u_Menu();
  409. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  410. n3u_Block('header');
  411. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  412. break;
  413. case "terms": // If Terms, do this
  414. n3u_CacheBegin(); // Start Caching
  415. echo '<!DOCTYPE html>' . PHP_EOL
  416. . '<html>' . PHP_EOL
  417. . "\t" . '<head>' . PHP_EOL
  418. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  419. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  420. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  421. . "\t\t" . '<meta name="description" content="This is the Terms &amp; Conditions for ' . $n3u_configVars['SiteName'] . '. Please read over them carefully.">' . PHP_EOL
  422. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  423. . "\t\t" . '<title>' . $n3u_lang['TermsConditions'] . ' - ' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  424. if($n3u_configVars['CleanUrls'] == TRUE){
  425. echo "\t\t" . '<link rel="canonical" href="' . filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . str_replace('index.php','',$n3u_configVars['self']) .$n3u_inputVars['x'] . '.htm',FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  426. }else{
  427. echo "\t\t" . '<link rel="canonical" href="'. filter_var(preg_replace('((?<!:)(//+))','/',$n3u_configVars['SiteURL'] . $n3u_configVars['self'] . '?x='.$n3u_inputVars['x'],FILTER_SANITIZE_URL)) . '">' . PHP_EOL;
  428. }
  429. n3u_CacheCSS();
  430. n3u_CacheJS();
  431. echo "\t" . '</head>' . PHP_EOL
  432. . "\t" . '<body>' . PHP_EOL
  433. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  434. . "\t\t\t" . '<div id="header">' . PHP_EOL
  435. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  436. n3u_Menu();
  437. echo "\t\t\t\t" . '</div>' . PHP_EOL; // div Top
  438. n3u_Block('header');
  439. echo "\t\t\t" . '</div>' . PHP_EOL; //div header
  440. break;
  441. case "page":
  442. default:
  443. echo '<!DOCTYPE html>' . PHP_EOL
  444. . '<html>' . PHP_EOL
  445. . "\t" . '<head>' . PHP_EOL
  446. . "\t\t" . '<meta charset="UTF-8">' . PHP_EOL
  447. . "\t\t" . '<meta name="author" content="n3u.com">' . PHP_EOL
  448. . "\t\t" . '<meta name="application-name" content="n3u Niche Store ' . $n3u_configVars['Version']. '">' . PHP_EOL
  449. . "\t\t" . '<meta name="robots" content="index,follow">' . PHP_EOL
  450. . "\t\t" . '<title>' . $n3u_configVars['SiteName'] . '</title>' . PHP_EOL;
  451. n3u_CacheCSS();
  452. n3u_CacheJS();
  453. echo "\t" . '</head>' . PHP_EOL
  454. . "\t" . '<body>' . PHP_EOL
  455. . "\t\t" . '<div id="wrapper">' . PHP_EOL
  456. . "\t\t\t" . '<div id="header">' . PHP_EOL
  457. . "\t\t\t\t" . '<div id="Top">' . PHP_EOL;
  458. n3u_Menu();
  459. echo "\t\t\t\t" . '</div>' . PHP_EOL // div Top
  460. . "\t\t\t" . '</div>' . PHP_EOL; //div header
  461. break;
  462. }
  463. ?>