Advertisement
Guest User

Untitled

a guest
Jan 13th, 2016
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 75.97 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: [Add Listing]
  4. */
  5. /* =============================================================================
  6. [PREMIUMPRESS FRAMEWORK] THIS FILE SHOULD NOT BE EDITED
  7. ========================================================================== */
  8. if (!defined('THEME_VERSION')) { header('HTTP/1.0 403 Forbidden'); exit; }
  9. /* ========================================================================== */
  10.  
  11. global $CORE, $userdata; // grabs the user info and puts into vars
  12.  
  13. // CHECK IF WE ARE FORCING USERS TO REGISTER
  14. if(get_option('users_can_register') != 1){ $CORE->Authorize(); }
  15.  
  16.  
  17. // GET PACKAGES / MEMBERSHIP LIST DATA
  18. $packagefields = get_option("packagefields"); if(!is_array($packagefields)){ $packagefields = array(); }
  19. $membershipfields = get_option("membershipfields");
  20.  
  21. // CHECK IF WE HAVE ENABLED VISITOR SUBMISSIONS
  22. if(isset($GLOBALS['CORE_THEME']['visitor_submission']) && ( $GLOBALS['CORE_THEME']['visitor_submission'] == 0 && isset($_POST['packageID']) || $GLOBALS['CORE_THEME']['visitor_submission'] == 0 && $CORE->_PACKNOTHIDDEN($packagefields) == 0 ) && !isset($_POST['pakid']) ){ $CORE->Authorize(); }
  23.  
  24. //STOP MEMBERSHIPS NON-PAID FOR CREATING LISTINGS
  25. if(isset($GLOBALS['CORE_THEME']['show_mem_registraion']) && $GLOBALS['CORE_THEME']['show_mem_registraion'] == '1' && !isset($_POST['membershipID']) ){
  26. $TEMPMEMID = get_user_meta($userdata->ID,'new_memID',true);
  27. if(isset($TEMPMEMID) && is_numeric($TEMPMEMID) && isset($membershipfields[$TEMPMEMID]['price']) && $membershipfields[$TEMPMEMID]['price'] > 0){
  28. wp_redirect( $GLOBALS['CORE_THEME']['links']['myaccount']."?submissionlimit=1" ); exit;
  29. }
  30. }
  31.  
  32. // SET FLAGS
  33. $GLOBALS['tpl-add'] = true; $data = array();
  34.  
  35. // DISABLE LEFT ANF RIGHT SIDEBARS
  36. $GLOBALS['nosidebar-left'] = true; $GLOBALS['nosidebar-right'] = true;
  37.  
  38. // ADD ON TRANSFER STYLES
  39. wp_register_style( 'c1', FRAMREWORK_URI.'css/css.bootstrap-transfer.css');
  40. wp_enqueue_style( 'c1' );
  41. wp_register_script( 'c2', FRAMREWORK_URI.'js/jquery.bootstrap-transfer.js');
  42. wp_enqueue_script( 'c2' );
  43.  
  44. wp_register_script( 'googlemap', $CORE->googlelink());
  45. wp_enqueue_script( 'googlemap' );
  46.  
  47. // ADD-ON PLAYER FILES ENCASE WE HAVE VIDEO
  48. wp_enqueue_script('video', FRAMREWORK_URI.'player/mediaelement-and-player.min.js');
  49. wp_enqueue_script('video');
  50.  
  51.  
  52.  
  53. $GLOBALS['current_membership'] = get_user_meta($userdata->ID,'wlt_membership',true);
  54. $GLOBALS['current_membership_expires'] = get_user_meta($userdata->ID,'wlt_membership_expires',true);
  55.  
  56. // CHECK IF THE USER HAS REACHED THEIR SUBMISSION LIMIT
  57. if($userdata->ID && !isset($_POST['eid']) && !isset($_GET['eid']) && isset($GLOBALS['current_membership']) && isset($membershipfields[$GLOBALS['current_membership']]['submissionamount']) && !isset($_POST['membershipID']) ){
  58. // COUNT USER SUBMISSIONS
  59. $current_submissions = $CORE->count_user_posts_by_type( $userdata->ID, THEME_TAXONOMY."_type" );
  60.  
  61. if(!isset($_POST['eid']) && $current_submissions >= $membershipfields[$GLOBALS['current_membership']]['submissionamount']){
  62. wp_redirect( $GLOBALS['CORE_THEME']['links']['myaccount']."?submissionlimit=1" ); exit;
  63. }
  64. }
  65.  
  66. // CHECK FOR CUSTOM LINKS
  67. if(isset($_GET['pakid']) && is_numeric($_GET['pakid'])){ $_POST['packageID'] = $_GET['pakid']; }
  68.  
  69. /* =============================================================================
  70. USER ACTIONS
  71. ========================================================================== */
  72. if(isset($_POST['action']) && $_POST['action'] !=""){
  73. switch($_POST['action']){
  74. case "renewalfree": {
  75.  
  76. // 1. GET PACKAGE DATA
  77. $packagefields = get_option("packagefields");
  78.  
  79. // 2. FIND OUT EXISTING PACKAGE ID
  80. $packageID = get_post_meta($_POST['pid'],'packageID',true);
  81. $renewal_days = 30;
  82.  
  83. // 3. GET PRICE AND DATE
  84. if(isset($packagefields[$packageID]['expires']) && is_numeric($packagefields[$packageID]['expires']) ){
  85. $renewal_days = $packagefields[$packageID]['expires'];
  86. if($renewal_days == ""){ $renewal_days = 30; }
  87. }
  88.  
  89. // 3. UPDATE LISTING
  90. update_post_meta( $_POST['pid'], 'listing_expiry_date', date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s") . " +".$renewal_days." days")) );
  91. update_post_meta( $_POST['pid'], 'current_bid_data', '' );
  92. update_post_meta( $_POST['pid'], 'price_current', '0' );
  93.  
  94. // UPDATE THE LISTING TO MAKE IT ACTIVE
  95. $my_post = array();
  96. $my_post['ID'] = $_POST['pid'];
  97. $my_post['post_status'] = "publish";
  98. wp_update_post( $my_post );
  99.  
  100. // 4. LEAVE A MESSAGE
  101. $GLOBALS['error_message'] = $CORE->_e(array('account','74'));
  102.  
  103. } break;
  104.  
  105. case "save": {
  106.  
  107. // VALIDATION
  108. if(strlen($_POST['form']['post_title']) < 2){
  109. $GLOBALS['error_message'] = $CORE->_e(array('add','23'));
  110. }else{
  111.  
  112. // START FLAG
  113. $canContinue = true; $packagefields = get_option("packagefields");
  114.  
  115. // BLANK OUT THE PACKAGE PRICE FOR MEMBERSHIP LISTINGS
  116. if(isset($GLOBALS['current_membership']) && !is_string($GLOBALS['current_membership']) && is_numeric($GLOBALS['current_membership'])){
  117.  
  118. $_POST['packageID'] = $membershipfields[$GLOBALS['current_membership']]['package'];
  119. $packagefields[$_POST['packageID']]['price'] = 0; // SET THE PRICE FOR THIS PACKAGE TO 0
  120. }
  121.  
  122. // START BUILDING ARRAY OF DATA
  123. $my_post = array();
  124. $my_post['post_type'] = THEME_TAXONOMY."_type";
  125. $my_post['post_title'] = esc_html($_POST['form']['post_title']);
  126. $my_post['post_modified'] = date("Y-m-d h:i:s");
  127. // STRIP TAGS FROM NON-HTML CONTENT LISTINGS
  128.  
  129. if( (isset($_GET['eid']) && get_post_meta($_GET['eid'],'html',true) == "yes" ) ||
  130. ( isset($_POST['packageID']) &&
  131. is_array($packagefields) &&
  132. !empty($packagefields) &&
  133. isset($packagefields[$_POST['packageID']]['enhancement']['3']) &&
  134. $packagefields[$_POST['packageID']]['enhancement']['3'] == 1 ) ||
  135. ( isset($_POST['enhancement'][3]) && $_POST['enhancement'][3] == "on") ){
  136.  
  137. $my_post['post_content'] = stripslashes($_POST['form']['post_content']);
  138. }else{
  139. $my_post['post_content'] = stripslashes(strip_tags(str_replace("http://","",str_replace("https://","",$_POST['form']['post_content']))));
  140. }
  141.  
  142.  
  143. // REMOVE OPTION GROUP
  144. $newca = array();
  145. if(is_array($_POST['form']['category'])){
  146. foreach($_POST['form']['category'] as $cat){
  147. if(!is_numeric($cat) ){ continue; }
  148. $newca[] = $cat;
  149. }
  150. }
  151.  
  152. // SAVE
  153. $my_post['post_category'] = $newca;
  154.  
  155. // WORK OUT PACKAGE PRICE AND SAVE THIS FOR LATER PAYMENT
  156. $total_price_due = 0;
  157. if(is_array($_POST['enhancement'])){
  158. foreach($_POST['enhancement'] as $key=>$val){
  159.  
  160. if($val == "on" && is_numeric($GLOBALS['CORE_THEME']['enhancement'][$key.'_price']) ){
  161.  
  162. // NOW CHECK ITS NOT INCLUDED IN THE PACKAGE PRICE
  163. if(isset($packagefields[$_POST['packageID']]['enhancement'][$key]) &&
  164. $packagefields[$_POST['packageID']]['enhancement'][$key] == "1" ){}else{
  165.  
  166. $total_price_due += $GLOBALS['CORE_THEME']['enhancement'][$key.'_price'];
  167.  
  168. }
  169. }
  170. } // end foreach
  171. }// end if
  172.  
  173. // WORK OUT ANY ADDITIONAL PRICE PER CATEGORY ITEMS
  174. $extra_price_due = 0; $total_price_removed = 0; $current_catprices = get_option('wlt_catprices');
  175. if(is_array($current_catprices)){
  176. /** work out price before (with newly selected cats) ***/
  177. foreach($my_post['post_category'] as $kk=>$catID){
  178. if(isset($current_catprices[$catID])
  179. && ( isset($current_catprices[$catID]) && is_numeric($current_catprices[$catID]) && $current_catprices[$catID] > 0 ) ){
  180. $extra_price_due += $current_catprices[$catID];
  181. }
  182. }
  183.  
  184. /*** if were editing we need to remove cats already paid for ***/
  185. if(isset($_POST['eid'])){
  186. $term_list = wp_get_post_terms($_POST['eid'], THEME_TAXONOMY, array("fields" => "ids"));
  187. /*** now remove existing ones ***/
  188. foreach($term_list as $k=>$pc) {
  189. if(isset($current_catprices[$pc])
  190. && ( isset($current_catprices[$pc]) && is_numeric($current_catprices[$pc]) && $current_catprices[$pc] > 0 ) ){
  191. $total_price_removed += $current_catprices[$pc];
  192. }
  193. /*** unset from array ***/
  194. unset($checkcatsArray[$pk]);
  195. } // end foreach
  196. }
  197. /*** update the total price with the new amount ***/
  198. $total_price_due += $extra_price_due;
  199. //die("new price: ".$extra_price_due." // price removed:".$total_price_removed);
  200. }// end if
  201.  
  202. // PACKAGE PRICE ON TOP
  203. if(isset($_POST['packageID']) && is_numeric($_POST['packageID']) && $_POST['packageID'] != 99){
  204. // DONT ADD PRICE ON IF ITS IN MEMBERSHIP
  205. if($GLOBALS['current_membership'] != "" && is_numeric($GLOBALS['current_membership']) && is_array($membershipfields) ){
  206. if($membershipfields[$GLOBALS['current_membership']]['package'] == $_POST['packageID']){
  207. }else{
  208. $total_price_due += $packagefields[$_POST['packageID']]['price'];
  209. }
  210. }else{
  211. $total_price_due += $packagefields[$_POST['packageID']]['price'];
  212. }
  213.  
  214. // REDUNCE CATEGORIES IF EXCEEDING AMOUNT
  215. if($packagefields[$_POST['packageID']]['multiple_cats'] == 0){
  216.  
  217. $my_post['post_category'] = array($my_post['post_category'][0]);
  218.  
  219. }elseif(is_numeric($packagefields[$_POST['packageID']]['multiple_cats_amount']) && count($my_post['post_category']) > $packagefields[$_POST['packageID']]['multiple_cats_amount']){
  220.  
  221. $ecats = $my_post['post_category']; $ncats = array(); $i =0;
  222. while($i < $packagefields[$_POST['packageID']]['multiple_cats_amount']){
  223. $ncats[] = $ecats[$i];
  224. $i++;
  225. }
  226. $my_post['post_category'] = $ncats;
  227. }
  228. }
  229.  
  230. // CHECK AND SET POST STATUS
  231. if(!isset($_POST['eid'])){
  232. if( $total_price_due == "" || $total_price_due < 1 ){
  233.  
  234. $admin_default_status = $GLOBALS['CORE_THEME']['default_listing_status'];
  235. if($admin_default_status == "pending"){
  236. $my_post['post_status'] = "pending";
  237. }else{
  238. $my_post['post_status'] = "publish";
  239. }
  240.  
  241. }else{
  242. $my_post['post_status'] = "pending";
  243. }
  244. }// end if no edit
  245.  
  246.  
  247. // IF WE ARE NOT LOGGED IN AND THIS IS A GUEST SUBMISSION
  248. // CREATE THEM AN ACCOUNT AND ASSIGN THE LISTING TO THEM
  249. if(!isset($_POST['adminedit'])){
  250. if( ( !isset($userdata) ) || ( isset($userdata) && !$userdata->ID ) ){
  251.  
  252. // CHECK IF THE USER EXISTS ALREADy
  253. if ( email_exists($_POST['form']['email']) ){
  254.  
  255. $user = get_user_by('email', $_POST['form']['email']);
  256. $user_ID = $user->data->ID;
  257. $userdata = $user_ID;
  258. $canContinue = false;
  259. $errorMsg = $CORE->_e(array('add','52'));
  260. }else{
  261.  
  262. // CHECK IF WE HAVE A VALID EMAIL OTHERWISE ASSIGN POST TO ADMIN
  263. $user_email = $_POST['form']['email'];
  264. // CHECK IF USERNAME EXISTS
  265. $new_user_name = $_POST['form']['new_username'];
  266. if ( username_exists( $new_user_name ) ){
  267. $new_user_name = $_POST['form']['new_username'].date('d');
  268. }
  269. // SETUP NEW PASSWORD
  270. if(isset($_POST['form']['new_password']) && strlen($_POST['form']['new_password']) > 2 ){
  271. $random_password = $_POST['form']['new_password'];
  272. }else{
  273. $random_password = wp_generate_password( 12, false );
  274. }
  275.  
  276. // CREATE NEW USER
  277. $user_ID = wp_create_user( $new_user_name, $random_password, $user_email );
  278.  
  279. if (!is_wp_error($user_ID)){
  280. // AUTO LOGIN NEW USER
  281. $creds = array();
  282. $creds['user_login'] = $new_user_name;
  283. $creds['user_password'] = $random_password;
  284. $creds['remember'] = true;
  285. $userdata = wp_signon( $creds, false );
  286.  
  287. }else{
  288. $errorMsg = $user_ID->get_error_message();
  289. $canContinue = false;
  290. }
  291. }
  292. $my_post['post_author'] = $user_ID;
  293.  
  294. // SEND THE NEW USER THEIR LOGIN DETAILS
  295. wp_new_user_notification( $user_ID, $random_password );
  296. // SEND WELCOME EMAIL
  297. $_POST['password'] = $random_password;
  298. $CORE->SENDEMAIL($user_ID,'welcome');
  299.  
  300. }else{
  301. $my_post['post_author'] = $userdata->ID;
  302. }
  303. } // end if is not admin edit
  304.  
  305. // SAVE THE DATA
  306. if(isset($_POST['eid'])){
  307. $my_post['ID'] = $_POST['eid'];
  308. wp_update_post( hook_add_form_post_save_data($my_post) );
  309. $POSTID = $_POST['eid'];
  310. $GLOBALS['PID'] = $POSTID;
  311. // ADD LOG ENTRY
  312. $CORE->ADDLOG("<a href='(ulink)'>".$userdata->user_nicename.'</a> update their listing <a href="(plink)"><b>['.$my_post['post_title'].']</b></a>.', $userdate->ID,$_POST['eid'],'label-success');
  313.  
  314. update_post_meta($POSTID,'pending_message',''); // CLEAR ANY ADMIN MESSAGES SINCE WE'VE EDITED
  315.  
  316. }else{
  317. $POSTID = wp_insert_post( hook_add_form_post_save_data($my_post) );
  318. $GLOBALS['PID'] = $POSTID;
  319. // ADD IN DEFAULT ACCES IF SET
  320. if(isset($GLOBALS['CORE_THEME']['default_access']) && is_array($GLOBALS['CORE_THEME']['default_access'])){
  321. add_post_meta($POSTID, 'access', $GLOBALS['CORE_THEME']['default_access']);
  322. }
  323. // DEFAULT FOR NEW LISTINGS
  324. add_post_meta($POSTID, 'hits', 0);
  325. // CREATE SHORTCODES FOR EMAIL
  326. $_POST['title'] = $_POST['form']['post_title'];
  327. $_POST['link'] = get_permalink($POSTID);
  328. $_POST['post_date'] = hook_date(date("Y-m-d h:i:s"));
  329.  
  330. // SEND NEW LISTING EMAIL
  331. $CORE->SENDEMAIL($userdata->user_email,'newlisting');
  332. $CORE->SENDEMAIL('admin','admin_newlisting');
  333.  
  334. // CHECK FOR USER SUBSCRIPTION EMAILS
  335. if(is_array($my_post['post_category']) && $userdata->ID ){
  336. foreach($my_post['post_category'] as $kk=>$catID){
  337. $SQL = "SELECT user_id FROM ".$wpdb->prefix."usermeta WHERE meta_value LIKE ('%*".strip_tags($catID)."*%') AND meta_key='email_subscriptions'";
  338. $sub_results = $wpdb->get_results($SQL);
  339.  
  340. if (!empty($sub_results) ) {
  341. foreach($sub_results as $val){
  342. $user_info = get_userdata($val->user_id);
  343. $_POST['username'] = $user_info->first_name . ' ' . $user_info->last_name;
  344. $CORE->SENDEMAIL($val->user_id,'subscription_email');
  345. }
  346. }
  347. }
  348. }
  349.  
  350. // ADD LOG ENTRY
  351. $CORE->ADDLOG("<a href='(ulink)'>".$userdata->user_nicename.'</a> added a new listing <a href="(plink)"><b>['.$my_post['post_title'].']</b></a>.', $userdata->ID, $POSTID ,'label-info');
  352. }
  353.  
  354. // POST TAGS
  355. wp_set_post_tags( $POSTID, strip_tags($_POST['custom']['post_tags']), false);
  356.  
  357. // ADD HOOK FOR ANY PLUGIN OPTIONS
  358. hook_add_form_post_save_extra($POSTID);
  359.  
  360. // UPDATE CAT LIST
  361. wp_set_post_terms( $POSTID, $my_post['post_category'], THEME_TAXONOMY );
  362.  
  363. // ADD IN CUSTOM FIELDS
  364. update_post_meta($POSTID, 'packageID', $_POST['packageID']);
  365. update_post_meta($POSTID, 'listing_price', $total_price_due);
  366.  
  367. // IF IS MEMBERSHIP THEN SET THE PRICE TO 0
  368. if(is_numeric($GLOBALS['current_membership']) && $total_price_due == 0){
  369. update_post_meta($POSTID, 'listing_price_paid', 0);
  370. }
  371.  
  372. // MAKE THIS GLOBAL FOR BOTH EDIT AND NON-EDITS BELOW
  373. $earray = array(
  374. '1' => array('dbkey'=>'frontpage','text'=>'Front Page Exposure'),
  375. '2' => array('dbkey'=>'featured','text'=>'Highlighted Listing'),
  376. '3' => array('dbkey'=>'html','text'=>'HTML Listing Content'),
  377. '4' => array('dbkey'=>'visitorcounter','text'=>'Visitor Counter'),
  378. '5' => array('dbkey'=>'topcategory','text'=>'Top of Category Results Page'),
  379. '6' => array('dbkey'=>'showgooglemap','text'=>'Google Map'),
  380. );
  381.  
  382. // CUSTOM FIELDS FOR enhancementS
  383. if(!isset($_POST['eid'])){
  384. $onoff = array();
  385. if(is_array($_POST['enhancement']) && isset($_POST['enhancement'][1]) && $_POST['enhancement'][1] == "on" ){ $onoff[1] = "yes"; }else{ $onoff[1] = "no"; }
  386. if(is_array($_POST['enhancement']) && isset($_POST['enhancement'][2]) && $_POST['enhancement'][2] == "on" ){ $onoff[2] = "yes"; }else{ $onoff[2] = "no"; }
  387. if(is_array($_POST['enhancement']) && isset($_POST['enhancement'][3]) && $_POST['enhancement'][3] == "on" ){ $onoff[3] = "yes"; }else{ $onoff[3] = "no"; }
  388. if(is_array($_POST['enhancement']) && isset($_POST['enhancement'][4]) && $_POST['enhancement'][4] == "on" ){ $onoff[4] = "yes"; }else{ $onoff[4] = "no"; }
  389. if(is_array($_POST['enhancement']) && isset($_POST['enhancement'][5]) && $_POST['enhancement'][5] == "on" ){ $onoff[5] = "yes"; }else{ $onoff[5] = "no"; }
  390. if(is_array($_POST['enhancement']) && isset($_POST['enhancement'][6]) && $_POST['enhancement'][6] == "on" ){ $onoff[6] = "yes"; }else{ $onoff[6] = "no"; }
  391. // LETS CHECK TO SEE IF WE HAVE ANY ENABLED BY DEFAULT AND IF THE DISPLAY IT TURNED OFF
  392. if( $GLOBALS['CORE_THEME']['show_enhancements'] != '1' && isset($_POST['packageID']) ){ // display is off so we do it manually
  393. foreach($earray as $key=>$val){
  394. if(is_array($packagefields) && !empty($packagefields) && isset($packagefields[$_POST['packageID']]['enhancement'][$key]) && $packagefields[$_POST['packageID']]['enhancement'][$key] == "1"){
  395. $onoff[$key] = "yes";
  396. }elseif( is_numeric($GLOBALS['current_membership']) && isset($membershipfields[$GLOBALS['current_membership']]['enhancement'][$key]) && $membershipfields[$GLOBALS['current_membership']]['enhancement'][$key] == "1"){
  397. $onoff[$key] = "yes";
  398. }
  399. }
  400. }
  401. // NOW LETS UPDATE THE POST FIELDS
  402. update_post_meta($POSTID, 'frontpage', $onoff[1]); // font page
  403. update_post_meta($POSTID, 'featured', $onoff[2]); // featured
  404. update_post_meta($POSTID, 'html', $onoff[3]); // html content
  405. update_post_meta($POSTID, 'visitorcounter', $onoff[4]); // visitor counter
  406. update_post_meta($POSTID, 'topcategory', $onoff[5]); // visitor counter
  407. update_post_meta($POSTID, 'showgooglemap', $onoff[6]); // visitor counter
  408. update_post_meta($POSTID, 'listing_price_due', $total_price_due);
  409.  
  410. }else{
  411.  
  412. // UPDATING AND POSSIBLY ADDING EXTRA FEATURES TO AN EXISTING LISTING
  413. if(isset($_POST['upgradepakid']) && is_numeric($_POST['upgradepakid'])){
  414. $existing_total_due = $total_price_due;
  415. }else{
  416. $existing_total_due = get_post_meta($POSTID,'listing_price_due',true);
  417. // NOW REMOVE ANY CHANGES MADE BY THE USER
  418. $existing_total_due = $existing_total_due -$total_price_removed;
  419. // NOW LETS ADD-ON ANY CHANGES MADE BY THE USER
  420. $existing_total_due = $existing_total_due + $extra_price_due;
  421. }
  422.  
  423. // LOOP PACKAGE DATA WHEN THE enhancement ARE VISIBLE
  424. // TO THE USER AND THEREFORE STORED IN POST DATA
  425. if(is_array($_POST['enhancement']) && !isset($_POST['upgradepakid']) ){
  426.  
  427. foreach($earray as $key=>$val){
  428. if(is_array($_POST['enhancement']) && isset($_POST['enhancement'][$key]) && $_POST['enhancement'][$key] == "on" && get_post_meta($POSTID, $val['dbkey'], true) != "yes" ){
  429. update_post_meta($POSTID, $val['dbkey'], 'yes');
  430. $existing_total_due += $GLOBALS['CORE_THEME']['enhancement'][$key.'_price'];
  431. }elseif( is_array($_POST['enhancement']) && isset($_POST['enhancement'][$key]) && $_POST['enhancement'][$key] == "on" && get_post_meta($POSTID, $val['dbkey'], true) == "yes" ){
  432.  
  433. }elseif( !isset($_POST['enhancement'][$key]) && get_post_meta($POSTID, $val['dbkey'], true) == "yes" ){
  434. update_post_meta($POSTID, $val['dbkey'], 'no');
  435. $existing_total_due -= $GLOBALS['CORE_THEME']['enhancement'][$key.'_price'];
  436. }
  437. } // end foreach
  438.  
  439. }elseif(isset($_POST['upgradepakid']) ){ //!is_array($_POST['enhancement']) &&
  440.  
  441. foreach($earray as $key=>$val){
  442.  
  443. if($packagefields[$_POST['upgradepakid']]['enhancement'][$key] == 1){
  444. update_post_meta($POSTID, $val['dbkey'], 'yes');
  445. }else{
  446. update_post_meta($POSTID, $val['dbkey'], 'no');
  447. }
  448. } // end foreach
  449.  
  450. }
  451.  
  452. // JUST ENCASE
  453. if($existing_total_due < 0){ $existing_total_due = 0; }
  454. // SAVE NEW PRICE
  455. update_post_meta($POSTID, 'listing_price_due', $existing_total_due);
  456. // SET LISTING TO PENDING PAYMENT
  457.  
  458. if(is_numeric($existing_total_due) && $existing_total_due > 0){
  459. $new_status = "pending";
  460. }else{
  461. if(get_post_status ( $_POST['eid'] ) == "pending"){
  462. $new_status = "pending";
  463. }else{
  464. $new_status = "publish";
  465. }
  466.  
  467. }
  468.  
  469. $my_post = array();
  470. $my_post['ID'] = $POSTID;
  471. $my_post['post_status'] = $new_status;
  472. wp_update_post( $my_post );
  473. }
  474.  
  475. // SET EXPIRY DATE
  476.  
  477. if(isset($_POST['custom']['listing_expiry_date']) && is_numeric($_POST['custom']['listing_expiry_date'])){
  478.  
  479. update_post_meta($POSTID, 'listing_expiry_date', date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s") . " +".$_POST['custom']['listing_expiry_date']." days")));
  480. update_post_meta($POSTID, 'listing_expiry_days', $_POST['custom']['listing_expiry_date']);
  481.  
  482. }elseif($_POST['packageID'] != 99 && is_numeric($packagefields[$_POST['packageID']]['expires']) && !isset($_POST['eid']) ){
  483. update_post_meta($POSTID, 'listing_expiry_date', date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s") . " +".$packagefields[$_POST['packageID']]['expires']." days")));
  484. }
  485.  
  486. // SAVE THE CUSTOM DATA
  487. if(isset($_POST['custom']) && is_array($_POST['custom'])){
  488. foreach($_POST['custom'] as $key=>$val){ if($key == "listing_expiry_date"){ continue; }
  489.  
  490. // CLEAN SOME ATTRIBUTES
  491. if(substr($key,0,5) == "price"){
  492. $val = preg_replace('/[^\da-z.]/i', '', $val);
  493. }
  494.  
  495. // SAVE DATA
  496. if(is_array($val)){
  497. update_post_meta($POSTID, strip_tags($key), $val);
  498. }else{
  499. update_post_meta($POSTID, strip_tags($key), esc_html(strip_tags($val)));
  500. }
  501. }
  502. }
  503.  
  504.  
  505. // SAVE THE TAXONOMY DATA
  506. if(isset($_POST['tax']) && is_array($_POST['tax'])){
  507. foreach($_POST['tax'] as $key=>$val){
  508.  
  509. // CHECK IF ITS A NEW VALUE
  510. if(substr($val,0,11) == "newtaxvalue" ){
  511.  
  512. $newcatID = str_replace("newtaxvalue_","", $val);
  513.  
  514. if ( is_term( $newcatID , $key ) ){
  515. $term = get_term_by('name', str_replace("_"," ",$newcatID), $key);
  516. $val = $term->term_id;
  517. }else{
  518.  
  519. // FIX FOR MAKE/MODEL GET PARENT ID
  520. $parentID = 0;
  521. if($key == "model"){
  522. $parentID = $_POST['tax']['make'];
  523. }
  524.  
  525. $args = array('cat_name' => str_replace("_"," ",$newcatID), "parent" => $parentID );
  526. $term = wp_insert_term( str_replace("_"," ",$newcatID), $key, $args);
  527. if(isset($term['term_id'])){
  528. $val = $term['term_id'];
  529. }else{
  530. $val = $term->term_id;
  531. }
  532. }
  533.  
  534. }
  535.  
  536. // SAVE DATA
  537. wp_set_post_terms( $POSTID, $val, $key );
  538. }
  539. }
  540.  
  541. // CHECK FOR FILE UPLOAD
  542. if(isset($_FILES['image']) && is_array($_FILES['image']) ){ // &&
  543. $u=0;
  544. foreach($CORE->reArrayFiles($_FILES['image']) as $file_upload){
  545. if(strlen($file_upload['name']) > 1){
  546. if(isset($_POST['eid']) || $u == 0){
  547. $responce = hook_upload($POSTID, $file_upload,true);
  548. }else{
  549. $responce = hook_upload($POSTID, $file_upload);
  550. }
  551. if(isset($responce['error'])){
  552. $canContinue = false;
  553. $errorMsg = $responce['error'];
  554. }// end if
  555. $u++;
  556. } // end if
  557. } // end foeach
  558. } // end if
  559.  
  560. $GLOBALS['POSTID'] = $POSTID;
  561. do_action('hook_add_form_post_save');
  562.  
  563. // REDIRECT LINK
  564. $redirect = get_permalink($POSTID);
  565.  
  566. // REDIRECT TO NEXT PAGE
  567. if($canContinue && $redirect != ""){
  568. header("location: ".$redirect);
  569. exit();
  570. }else{
  571.  
  572. //$GLOBALS['error_message'] = $errorMsg;
  573. $STRING = '<div>Votre fiche a été envoyé pour validation à notre administrateur. vous serez informé de sa publication dans les plus brefs délais</div>';
  574.  
  575. }
  576.  
  577. } // end invalid listing
  578.  
  579. } break;
  580.  
  581. }
  582.  
  583. }// end switch
  584.  
  585. // CHECK IF WE ARE EDITING A LISTING
  586. if(isset($_GET['eid']) && is_numeric($_GET['eid']) ){
  587.  
  588. // GET POST DATA
  589. $edit_data = get_post($_GET['eid']);
  590.  
  591. // CHECK WE ARE THE AUTHOR
  592. if($edit_data->post_author != $userdata->ID && !current_user_can('administrator') ){
  593. die("Not your post!");
  594. }
  595. // GET CATEGORY LIST FROM TERMS OBJEC
  596. $categories = wp_get_object_terms( $_GET['eid'], THEME_TAXONOMY );
  597. // GET CUSTM FIELD DATA
  598. $custom_fields = get_post_custom($_GET['eid']);
  599. foreach ( $custom_fields as $key => $value ){
  600. $data[$key] = $value[0];
  601. }
  602. // STORE DATA IN ARRAY TO BE PASSED TO OUR CORE FUNCTIONS
  603. $data['post_title'] = $edit_data->post_title;
  604. $data['post_excerpt'] = $edit_data->post_excerpt;
  605. $data['post_content'] = $edit_data->post_content;
  606. $data['cats'] = $categories;
  607. // GET THE PACKAGE ID
  608. $_POST['packageID'] = get_post_meta($_GET['eid'], 'packageID', true);
  609. if($_POST['packageID'] == ""){ $_POST['packageID'] =- 1; }
  610.  
  611. if(isset($_GET['upgradepakid']) && is_numeric($_GET['upgradepakid']) ){
  612. $_POST['packageID'] = $_GET['upgradepakid'];
  613. }
  614.  
  615. }
  616.  
  617.  
  618. if(isset($_POST['membershipID'])){
  619.  
  620. //DISPLAY HEADER
  621. get_header($CORE->pageswitch());
  622. // HOOK INTO THE PAYMENT GATEWAY ARRAY
  623. $payment_due = $membershipfields[$_POST['membershipID']]['price'];
  624. // GET FINAL PRICE AFTER COUPONS ETC
  625. $final_payment_due = hook_payment_package_price($payment_due);
  626.  
  627. $STRING = '<div class="panel panel-default"><div class="panel-heading">'.$CORE->_e(array('add','53')).' - '.hook_price($final_payment_due).'</div><div class="panel-body">
  628. <!--<div style="text-align:center">
  629. <p>Nous avons bien pris en compte vos informations.<br />Envoyez-nous votre chèque d\'un montant de <strong>100€ HT</strong> à l\'adresse suivante :</p>
  630. <p><strong>A2PR<br />Association pour la Promotion des Relations Professionnelles des Rotariens<br />
  631. 40, boulevard Emile Augier - 75116 Paris.</strong></p>-->
  632.  
  633. </div>
  634. ';
  635.  
  636. // EXPIRY DATES
  637. if($membershipfields[$_POST['membershipID']]['expires'] == ""){ $expire_days = 365; }else{ $expire_days = $membershipfields[$_POST['membershipID']]['expires']; }
  638.  
  639. // // CHECK FOR PAYMENT
  640. // if($final_payment_due > 0){
  641. // $STRING .= "<h4>".$CORE->_e(array('add','53'))."</h4><hr />";
  642. // }else{
  643. // $STRING .= "<h4>".$CORE->_e(array('add','57'))."</h4><hr /><p>".$CORE->_e(array('add','58'))."</p>";
  644. // // UPGRADE USERS ACCOUNT
  645. // if($membershipfields[$_POST['membershipID']]['expires'] == ""){ $expire_days = 30; }else{ $expire_days = $membershipfields[$_POST['membershipID']]['expires']; }
  646. // update_user_meta( $userdata->ID, 'wlt_membership', $_POST['membershipID'] );
  647. // update_user_meta( $userdata->ID, 'wlt_membership_expires', date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s") . " +".$expire_days." days")) );
  648. // }
  649.  
  650. if($final_payment_due > 0){
  651. $STRING .= "<div class='row'><div class='col-md-12'>";
  652.  
  653. $gatway = hook_payments_gateways($GLOBALS['core_gateways']);
  654. if(is_array($gatway) && isset($membershipfields[$_POST['membershipID']]['price']) && $payment_due > 0 ){
  655.  
  656. // CHECK FOR RECURRING PAYMENTS
  657. $GLOBALS['days_till_expire'] = $expire_days;
  658.  
  659. // CREATE ORDER ID
  660. $GLOBALS['total'] = number_format($final_payment_due,2);
  661. $GLOBALS['subtotal'] = 0;
  662. $GLOBALS['shipping'] = 0;
  663. $GLOBALS['tax'] = 0;
  664. $GLOBALS['discount'] = 0;
  665. $GLOBALS['items'] = "";
  666.  
  667. $GLOBALS['orderid'] = "MEM-".$_POST['membershipID']."-".$userdata->ID."-".date("Ymd");
  668. $GLOBALS['description'] = $membershipfields[$_POST['membershipID']]['name'];
  669.  
  670. // LOOP AND DISPLAY GATEWAYS
  671. foreach($gatway as $Value){
  672. // GATEWAY IS ENABLED
  673. if(get_option($Value['function']) == "yes" ){
  674. // TEXT ONLY
  675. if( $Value['function'] == "gateway_bank" ){
  676. echo wpautop(get_option('bank_info'));
  677. // NOT BIG FORMS
  678. }elseif( !isset($Value['ownform']) ){
  679. $STRING .= '
  680.  
  681. <div class="col-md-8"><b>'.get_option($Value['function']."_name").'</b></div>
  682. <div class="col-md-4">'.$Value['function']($_POST).'</div>
  683.  
  684. <div class="clearfix"></div><hr />';
  685. // NORMAL FORMS
  686. }else{
  687. $STRING .= ''.$Value['function']($_POST).'<hr /><div class="clearfix"></div>';
  688. }// END IF
  689.  
  690. }// end if
  691. } // end foreach
  692. } // end if
  693.  
  694. $STRING .= $CORE->COUPONCODES();
  695. }// end if
  696.  
  697. // ADD IN TEST FOR ADMIN
  698. if(user_can($userdata->ID, 'administrator')){
  699. $STRING .= $CORE->admin_test_checkout();
  700. }
  701. echo $STRING."</div></div></div>";
  702.  
  703. }elseif(
  704.  
  705. ( ( is_array($packagefields) && count($packagefields) > 0 && $CORE->_PACKNOTHIDDEN($packagefields) > 0 ) || ( is_array($membershipfields) && count($membershipfields) > 0 && $CORE->_PACKNOTHIDDEN($packagefields) > 0 ) ) && $GLOBALS['current_membership'] == "" && !isset($_POST['packageID'])
  706.  
  707. ){
  708.  
  709. $GLOBALS['nosidebar-right'] = true; $GLOBALS['nosidebar-left'] = true;
  710.  
  711. //DISPLAY HEADER
  712. get_header($CORE->pageswitch());
  713.  
  714. // HOOK PACKAGES BEFORE
  715. hook_packages_before();
  716. // CHECK WE HAVE PACKAGES AVAILABLE
  717.  
  718. ?>
  719.  
  720.  
  721. <!-- memberships form -->
  722. <form method="post" name="MEMBERSHIPFORM" action="<?php echo $GLOBALS['CORE_THEME']['links']['add']; ?>" id="MEMBERSHIPFORM" style="margin:0px;padding:0px;">
  723. <input type="hidden" name="membershipID" id="membershipID" value="-1" />
  724. </form>
  725.  
  726. <?php function _core_display_packages_block(){ global $wpdb, $CORE; $packagefields = get_option("packagefields"); $membershipfields = get_option("membershipfields");
  727.  
  728. $STRING = '<!-- packages form -->
  729. <form method="post" name="PACKAGESFORM" action="'.$GLOBALS['CORE_THEME']['links']['add'].'" id="PACKAGESFORM">
  730. <input type="hidden" name="packageID" id="packageID" value="-1" />
  731. <div class="panel panel-default" id="PACKAGEBLOCK">
  732. <div class="panel-heading">'.$CORE->_e(array('add','1')).'</div>
  733. <div class="panel-body">
  734.  
  735. <i class="fa fa-magic mainicon hidden-xs"></i>
  736.  
  737. <p>'.$CORE->_e(array('add','27')).'</p>
  738. ';
  739.  
  740. if(isset($GLOBALS['CORE_THEME']['custom']['package_text'])){ $STRING .= wpautop(stripslashes($GLOBALS['CORE_THEME']['custom']['package_text'])); }
  741.  
  742. if(is_array($packagefields) && $CORE->_PACKNOTHIDDEN($packagefields) > 0){
  743. $STRING .='
  744. <div class="clearfix"></div>
  745.  
  746. <hr />
  747. <div class="packagesblock row">
  748. '.$CORE->packageblock(3,'packagefields',20).'
  749. </div>
  750. ';
  751. }
  752. if(is_array($membershipfields) && count($membershipfields) > 0 && isset($GLOBALS['CORE_THEME']['show_mem_listingpage']) && $GLOBALS['CORE_THEME']['show_mem_listingpage'] == 1){
  753. $STRING .='
  754. <div class="clearfix"></div>
  755. <hr />
  756. <h3 class="text-center">'.$CORE->_e(array('add','24')).'</h3>
  757. <p class="text-center">'.$CORE->_e(array('add','25')).'</p>
  758. <hr />
  759. <div class="packagesblock">
  760. <ul class="packagelistitems">'.$CORE->packageblock(3,'membershipfields',10).'</ul>
  761. </div>
  762. ';
  763. }
  764.  
  765.  
  766. $STRING .='<div class="clearfix"></div><hr /><p class="text-center"><i class="fa fa-history"></i> &nbsp;'.$CORE->_e(array('add','28')).'</p></div></div><!-- // END PACKAGELBOCK --> ';
  767. $STRING .='</form><!-- end packages form --><br />';
  768. return $STRING;
  769. }
  770.  
  771. echo hook_packages(_core_display_packages_block());
  772.  
  773. hook_packages_after(); ?>
  774.  
  775.  
  776.  
  777.  
  778. <?php }else{ // end if packageID
  779.  
  780. // CHECK IF WE HAVE ASSIGNED A PACKAGE ID AS PART OF THE USERS MEMBERSHIP
  781. if(!isset($_POST['packageID']) && is_numeric($GLOBALS['current_membership']) ){
  782. if(isset($membershipfields[$GLOBALS['current_membership']]['package']) && is_numeric($membershipfields[$GLOBALS['current_membership']]['package']) ){
  783. $_POST['packageID'] = $membershipfields[$GLOBALS['current_membership']]['package'];
  784. $packagefields[$_POST['packageID']]['price'] = 0; // SET THE PRICE FOR THIS PACKAGE TO 0
  785. }
  786. }
  787.  
  788. //DISPLAY HEADER
  789. get_header($CORE->pageswitch());
  790.  
  791. $total_price = 0; $total_days = 0; $total_packages_price = $GLOBALS['CORE_THEME']['enhancement']['1_price']+
  792. $GLOBALS['CORE_THEME']['enhancement']['2_price']+
  793. $GLOBALS['CORE_THEME']['enhancement']['3_price']+
  794. $GLOBALS['CORE_THEME']['enhancement']['5_price']+
  795. $GLOBALS['CORE_THEME']['enhancement']['6_price']+
  796. $GLOBALS['CORE_THEME']['enhancement']['4_price'];
  797.  
  798. // ADD-ON PACKAGE PRICE
  799. if(isset($_GET['eid']) && !isset($_GET['upgradepakid'])){
  800. $total_price = get_post_meta($_GET['eid'],'listing_price_due',true);
  801. }else{
  802. $total_price += $packagefields[$_POST['packageID']]['price'];
  803. }
  804.  
  805. // ADDED ADDITIONAL CLAUSE FOR PACKAGES BEING EMPTY
  806. if(empty($packagefields)){ $_POST['packageID'] = 99; }
  807.  
  808. // ADJUST DEFAULT UPLOAD IF PACKAGES ARE ENABLED
  809. if(isset($_POST['packageID']) && $_POST['packageID'] != "99" && $packagefields[$_POST['packageID']]['multiple_images'] == "1" && isset($packagefields[$_POST['packageID']]['max_uploads']) && is_numeric($packagefields[$_POST['packageID']]['max_uploads'])){
  810. $GLOBALS['default_upload_space'] = $packagefields[$_POST['packageID']]['max_uploads'];
  811. }elseif($CORE->_PACKNOTHIDDEN($packagefields) == 0 && $GLOBALS['CORE_THEME']['default_submission_fileuploads'] > 0){
  812. $GLOBALS['default_upload_space'] = $GLOBALS['CORE_THEME']['default_submission_fileuploads'];
  813. }elseif($GLOBALS['default_upload_space'] == 0){
  814. $GLOBALS['default_upload_space'] = 0;
  815. }else{
  816. $GLOBALS['default_upload_space'] = 5;
  817. }
  818.  
  819.  
  820. hook_add_before(); ?>
  821.  
  822.  
  823.  
  824.  
  825.  
  826. <?php if( isset($GLOBALS['CORE_THEME']['show_upgradeoptions']) && $GLOBALS['CORE_THEME']['show_upgradeoptions'] == 1){ ?>
  827. <form method="get" action="<?php echo $GLOBALS['CORE_THEME']['links']['add']; ?>" name="upgradeform">
  828. <input type="hidden" name="upgradepakid" id="upgradepakid" value="1" />
  829. <input type="hidden" name="eid" value="<?php echo $_GET['eid']; ?>" />
  830. </form>
  831. <?php } ?>
  832.  
  833.  
  834. <?php if(isset($_GET['eid'])){ echo $CORE->RENEW_TOOLBOX($_GET['eid'], true); } ?>
  835.  
  836. <form action="<?php echo $GLOBALS['CORE_THEME']['links']['add']; ?>" method="post" enctype="multipart/form-data" onsubmit="return VALIDATE_FORM_DATA();" id="SUBMISSION_FORM" >
  837. <input type="hidden" name="action" value="save" />
  838. <input type="hidden" name="packageID" value="<?php if(!isset($_POST['packageID']) && !is_numeric($_POST['packageID'])){ echo "-1"; }else{ echo $_POST['packageID']; } ?>" />
  839.  
  840. <?php if(isset($_GET['eid']) && is_numeric($_GET['eid']) ){ ?>
  841. <input type="hidden" name="eid" value="<?php echo $_GET['eid']; ?>" />
  842. <?php }elseif(isset($_POST['eid']) && is_numeric($_POST['eid']) ){ ?>
  843. <input type="hidden" name="eid" value="<?php echo $_POST['eid']; ?>" />
  844. <?php } ?>
  845.  
  846. <?php if(isset($_GET['adminedit']) && is_numeric($_GET['adminedit']) ){ ?>
  847. <input type="hidden" name="adminedit" value="1" />
  848. <?php } ?>
  849. <?php if(isset($_GET['upgradepakid']) && is_numeric($_GET['upgradepakid']) ){ ?>
  850. <input type="hidden" name="upgradepakid" value="<?php echo $_GET['upgradepakid']; ?>" />
  851. <?php } ?>
  852.  
  853.  
  854. <div class="row" >
  855. <aside class="col-md-4" id="steps_left_column">
  856. <div class="panel panel-default"><div class="panel-heading"><h4 class="panel-title"><?php echo $CORE->_e(array('add','69')); ?></h4></div>
  857. <div class="panel-body">
  858.  
  859.  
  860.  
  861.  
  862. <?php
  863. $canShowListingData = true;
  864.  
  865. if(isset($GLOBALS['CORE_THEME']['show_enhancements']) && $GLOBALS['CORE_THEME']['show_enhancements'] == '1'){
  866. if( ( !isset($_GET['eid']) && $total_packages_price+$total_price > 0 ) || ( isset($_GET['eid']) && ( get_post_meta($_GET['eid'], 'listing_price_paid',true) == "" || isset($_GET['upgradepakid']) ) && $total_packages_price+$total_price > 0 ) ){ ?>
  867.  
  868. <h4><?php echo $CORE->_e(array('add','7')); ?></h4>
  869. <p class="info"><?php echo $CORE->_e(array('add','8')); ?></p>
  870. <hr />
  871.  
  872. <!-- how does it work? -->
  873. <?php if($packagefields[$_POST['packageID']]['price'] > 0){ ?>
  874.  
  875. <?php } ?>
  876. <?php
  877.  
  878.  
  879. if($packagefields[$_POST['packageID']]['price']+$total_packages_price > 0){ ?>
  880. <?php if($total_packages_price > 0 ){ ?>
  881. <h4><?php echo $CORE->_e(array('add','31')); ?></h4>
  882. <p><?php echo $CORE->_e(array('add','32')); ?></p>
  883. <?php echo $CORE->packageenhancements(); ?>
  884. <hr />
  885. <?php } ?>
  886. <?php }
  887.  
  888.  
  889.  
  890.  
  891.  
  892. if(!is_numeric($total_price)){ $total_price = 0; }
  893. $total_days += $packagefields[$_POST['packageID']]['expires']; $canShowListingData = false;
  894. ?>
  895. <p><?php echo $CORE->_e(array('add','33')); ?>: </p>
  896. <div class="alert alert-success text-center totalpayment"><span id="listingprice"><?php echo number_format($total_price,2); ?> </span> <?php echo $GLOBALS['CORE_THEME']['currency']['symbol']; ?> HT
  897. <?php if($total_days > 0){ ?> <?php echo str_replace("%a",$total_days,$CORE->_e(array('add','34'))); ?><?php } ?>
  898. </div>
  899.  
  900. <?php /* end NEW PACKAGE OPTIONS ADDED IN NEW VERSION */ ?>
  901. <?php }
  902.  
  903. }
  904.  
  905. if(isset($_GET['eid']) && $canShowListingData ){ $ff = get_post($_GET['eid']);
  906.  
  907.  
  908. ?>
  909. <ul>
  910.  
  911. <li><span><?php echo $CORE->_e(array('add','6')); ?></span> <?php
  912. if(isset($packagefields[$_POST['packageID']]['name']) && $packagefields[$_POST['packageID']]['name'] != ""){
  913. echo $packagefields[$_POST['packageID']]['name'];
  914. }else{
  915. echo $CORE->_e(array('add','70'));
  916. }
  917.  
  918. ?> &nbsp; </li>
  919.  
  920. <li><span><?php echo $CORE->_e(array('single','17')); ?></span> <?php echo hook_date($ff->post_date); ?></li>
  921. <?php if($ff->post_date != $ff->post_modified){ ?>
  922. <li><span><?php echo $CORE->_e(array('single','18')); ?></span> <?php echo hook_date($ff->post_modified); ?></li>
  923. <?php } ?>
  924. <li><span><?php echo $CORE->_e(array('single','19')); ?></span> <?php echo get_post_meta($_GET['eid'],'hits',true).' '.$CORE->_e(array('single','33')); ?></li>
  925. <?php $expires = get_post_meta($_GET['eid'], 'listing_expiry_date',true); if($expires != ""){ ?>
  926. <li><span><?php echo $CORE->_e(array('single','20')); ?></span> <?php echo hook_date($expires); ?></li>
  927. <?php } ?>
  928. </ul>
  929.  
  930. <?php echo $CORE->RENEW_TOOLBOX($_GET['eid'], false); ?>
  931.  
  932. <?php } ?>
  933.  
  934. </div>
  935. </div>
  936.  
  937. </aside>
  938.  
  939.  
  940.  
  941. <?php
  942.  
  943. $steps = array(
  944. '1' => array('title' => $CORE->_e(array('add','35')) ), // ACCOUNT CREATION
  945. '2' => array('title' => $CORE->_e(array('add','63')) ),
  946. '3' => array('title' => $CORE->_e(array('add','64')) ),
  947. '4' => array('title' => $CORE->_e(array('add','65')) ),
  948. '5' => array('title' => $CORE->_e(array('add','66')) ),
  949. '6' => array('title' => $CORE->_e(array('add','67')) ),
  950. );
  951. $steps = hook_add_listtitles($steps);
  952.  
  953. // REMOVE STEPS IF NOT NEEDED
  954. if( ( !isset($userdata) ) || ( isset($userdata) && !$userdata->ID ) ){ }else{ unset($steps[1]); }
  955. if(isset($GLOBALS['CORE_THEME']['google']) && $GLOBALS['CORE_THEME']['google'] == 1){ }else{ unset($steps[6]); }
  956. if($GLOBALS['default_upload_space'] > 0 ){ }else{ unset($steps[4]); }
  957. if(isset($_GET['eid'])){ unset($steps[4]); }
  958.  
  959.  
  960. ?>
  961.  
  962.  
  963. <div class="<?php if(isset($_GET['mediaonly'])){ echo "col-md-12"; }else{ echo "col-md-8"; } ?>">
  964.  
  965. <?php do_action('hook_add_form_top'); /* HOOK */ ?>
  966.  
  967.  
  968. <div id="core_saving_wrapper" style="display:none;">
  969. <div class="alert alert-warning">
  970. <img src="<?php echo THEME_URI; ?>/framework/img/loading.gif" style="float:left; padding-right:30px;width:80px;" />
  971. <h1 style="padding-top:0px;margin-top:0px;"><?php echo $CORE->_e(array('add','29')); ?></h1>
  972. <p><?php echo $CORE->_e(array('add','30')); ?></p>
  973. <div class="clearfix"></div>
  974. </div>
  975. </div>
  976.  
  977. <?php if(isset($GLOBALS['CORE_THEME']['custom']['add_text'])){ echo stripslashes($GLOBALS['CORE_THEME']['custom']['add_text']); } ?>
  978.  
  979.  
  980. <div id="wlt_stepswizard" class="panel-group">
  981.  
  982.  
  983. <?php
  984. // UPGRADE OPTIONS
  985. if(isset($_GET['eid']) && $GLOBALS['CORE_THEME']['show_upgradeoptions'] == 1){ $showAmountUps = 0; ?>
  986.  
  987. <div class="bs-callout bs-callout-success" id="UpgradeOptionsBox">
  988. <div class="row">
  989. <div class="col-md-4"><h4><?php echo $CORE->_e(array('add','60')); ?></h4></div>
  990. <div class="col-md-7">
  991. <select onchange="jQuery('#upgradepakid').val(this.value);document.upgradeform.submit();" class="form-control">
  992. <option></option>
  993. <?php foreach($packagefields as $field){ if(!is_numeric($field['ID']) || $field['price'] == "" || $field['price'] == "0" || $field['ID'] == $_POST['packageID']){ continue; }
  994. if($field['hidden'] == "yes"){ continue; }
  995. $showAmountUps++;
  996. ?>
  997. <option value="<?php echo $field['ID']; ?>" <?php if(isset($_GET['upgradepakid']) && $_GET['upgradepakid'] == $field['ID']){ echo "selected=selected"; } ?>><?php echo $field['name']; ?> (<?php echo hook_price($field['price']); ?>)</option>
  998. <?php } ?>
  999. </select>
  1000. </div>
  1001. </div>
  1002. </div>
  1003.  
  1004. <?php if($showAmountUps == 0){ ?>
  1005. <style>#UpgradeOptionsBox { display:none; }</style>
  1006. <?php } ?>
  1007.  
  1008. <?php } ?>
  1009.  
  1010.  
  1011. <?php $i=1; foreach($steps as $k => $step){ ?>
  1012. <!--- STEP <?php echo $k; ?> --->
  1013. <div class="panel panel-default" <?php if(isset($_GET['mediaonly'])){ echo "style='display:none;'"; } ?> id="panel_section<?php echo $k; ?>">
  1014. <div class="panel-heading">
  1015. <h4 class="panel-title">
  1016. <span class="step-number"><?php echo $i; ?></span>
  1017. <?php
  1018.  
  1019. if($i == 1 && !isset($_GET['eid']) ){
  1020.  
  1021. if(isset($packagefields[$_POST['packageID']]['name']) && $packagefields[$_POST['packageID']]['name'] != ""){ echo '<div class="pull-right"><span class="label label-default">'.strip_tags($packagefields[$_POST['packageID']]['name'])."</span></div>"; }
  1022.  
  1023. }
  1024.  
  1025. ?>
  1026. <a href="#step<?php echo $i; ?>" class="astep<?php echo $i; ?> <?php if($k == 6){ echo 'mapboxlink'; } ?>" data-parent="#wlt_stepswizard" data-toggle="collapse"><?php echo $step['title'] ?></a>
  1027. </h4>
  1028. </div>
  1029. <div id="step<?php echo $i; ?>" class="stepblock<?php echo $k; ?> panel-collapse collapse <?php if($i ==1){ echo "in"; } ?>">
  1030. <div class="panel-body">
  1031.  
  1032. <?php
  1033.  
  1034. $field = array(); $o=0;
  1035.  
  1036. // SWITCH CONTENT BASED ON STEP
  1037. switch($k){
  1038.  
  1039. case "1": { // USER REGISTRATION
  1040.  
  1041. echo "<div class='bs-callout' id='new_user_registration'> <p>".$CORE->_e(array('add','36'))."</p>";
  1042. $field[$o]['title'] = $CORE->_e(array('login','10'));
  1043. $field[$o]['name'] = "new_username";
  1044. $field[$o]['type'] = "text";
  1045. $field[$o]['class'] = "form-control";
  1046. $field[$o]['required'] = true;
  1047. if(isset($GLOBALS['CORE_THEME']['visitor_password']) && $GLOBALS['CORE_THEME']['visitor_password'] == '1'){
  1048. $o++;
  1049. $field[$o]['title'] = $CORE->_e(array('account','10'));
  1050. $field[$o]['name'] = "new_password";
  1051. $field[$o]['type'] = "text";
  1052. $field[$o]['class'] = "form-control";
  1053. $field[$o]['required'] = true;
  1054. $field[$o]['password'] = true;
  1055. }
  1056. $o++;
  1057. $field[$o]['title'] = $CORE->_e(array('account','9'));
  1058. $field[$o]['name'] = "email";
  1059. $field[$o]['type'] = "text";
  1060. $field[$o]['class'] = "form-control";
  1061. $field[$o]['required'] = true;
  1062. echo $CORE->BUILD_FIELDS($field,$data);
  1063. echo '</div>';
  1064.  
  1065.  
  1066. } break;
  1067. case "2": { // LISTING DESCRIPTION
  1068.  
  1069. $field[$o]['title'] = $CORE->_e(array('add','10'));
  1070. $field[$o]['name'] = "post_title";
  1071. $field[$o]['type'] = "text";
  1072. $field[$o]['class'] = "form-control";
  1073. $field[$o]['required'] = true;
  1074. $field[$o]['ontop'] = true;
  1075. $field[$o]['placeholder'] = hook_add_post_title_text("");
  1076.  
  1077. $o++;
  1078. $field[$o]['title'] = $CORE->_e(array('add','12'));
  1079. $field[$o]['name'] = "post_content";
  1080. $field[$o]['type'] = "post_content";
  1081. $field[$o]['class'] = "form-control";
  1082. $field[$o]['ontop'] = true;
  1083.  
  1084. $o++;
  1085. $field[$o]['title'] = $CORE->_e(array('add','71'));
  1086. $field[$o]['name'] = "post_tags";
  1087. $field[$o]['type'] = "text";
  1088. $field[$o]['help'] = $CORE->_e(array('add','73'));
  1089. $field[$o]['class'] = "form-control";
  1090. $field[$o]['ontop'] = true;
  1091. $field[$o]['placeholder'] = $CORE->_e(array('add','71','flag_noedit')).", ".$CORE->_e(array('add','71','flag_noedit'));
  1092. echo $CORE->BUILD_FIELDS($field,$data);
  1093.  
  1094. } break;
  1095. case "3": {// CATEGORY SELECTION
  1096.  
  1097. $field[$o]['title'] = $CORE->_e(array('add','13'));
  1098. $field[$o]['name'] = "category";
  1099. $field[$o]['type'] = "category";
  1100. $field[$o]['class'] = "form-control";
  1101. if( isset($_POST['packageID']) && $packagefields[$_POST['packageID']]['multiple_cats'] == "1" ){
  1102. $field[$o]['multi'] = true;
  1103. }
  1104. // MAX CATEGORIES
  1105. if(isset($packagefields[$_POST['packageID']]['multiple_cats_amount']) && is_numeric($packagefields[$_POST['packageID']]['multiple_cats_amount']) ){
  1106. $field[$o]['max'] = $packagefields[$_POST['packageID']]['multiple_cats_amount'];
  1107. }else{
  1108. $field[$o]['max'] = 10;
  1109. }
  1110. echo $CORE->BUILD_FIELDS($field,$data);
  1111.  
  1112. } break;
  1113. case "4": { // LISTING ATTACHMENTS
  1114.  
  1115. $field[$o]['title'] = $CORE->_e(array('single','39'));
  1116. $field[$o]['name'] = "image";
  1117. $field[$o]['type'] = "image";
  1118. $field[$o]['class'] = "form-control";
  1119. if($GLOBALS['CORE_THEME']['require_image'] == 1){
  1120. $field[$o]['required'] = true;
  1121. }
  1122. $o++;
  1123. echo $CORE->BUILD_FIELDS($field,$data);
  1124.  
  1125. } break;
  1126. case "5": { // LISTING ATTRIBUTES
  1127.  
  1128. if(isset($_GET['eid']) && $GLOBALS['CORE_THEME']['field_listingstatus'] == 1){
  1129. $field[$o]['title'] = $CORE->_e(array('listvalues','title'));
  1130. $field[$o]['name'] = "listing_status";
  1131. $field[$o]['type'] = "select";
  1132. $field[$o]['listvalues'] = array("0" => $CORE->_e(array('listvalues','0')), "1" => $CORE->_e(array('listvalues','1')), "2" => $CORE->_e(array('listvalues','2')), "3" => $CORE->_e(array('listvalues','3')), "4" => $CORE->_e(array('listvalues','4')), "5" => $CORE->_e(array('listvalues','5')), "6" => $CORE->_e(array('listvalues','6')), "7" => $CORE->_e(array('listvalues','7')), "8" => $CORE->_e(array('listvalues','8')));
  1133. $field[$o]['class'] = "form-control";
  1134. $field[$o]['required'] = true;
  1135. // EXCLUDE FOR NON-REAL ESTATE
  1136. if(get_option('wlt_base_theme') != "template_realestate_theme"){
  1137. unset($field[$o]['listvalues']['2']);
  1138. unset($field[$o]['listvalues']['3']);
  1139. }
  1140. }
  1141.  
  1142. echo $CORE->BUILD_FIELDS(hook_add_fieldlist($field),$data);
  1143. echo $CORE->CORE_FIELDS(false,true); // CUSTOM FIELDS
  1144.  
  1145. } break;
  1146.  
  1147. case "6": { // GOOGLE MAP ?>
  1148.  
  1149. <div id="showmapbox">
  1150.  
  1151. <input name="custom[map_location]" id="form_map_location" class="controls" type="text" placeholder="<?php echo $CORE->_e(array('add','54','flag_noedit')); ?>" value="<?php if(isset($_GET['eid'])){ echo get_post_meta($_GET['eid'],'map_location',true); } ?>">
  1152. <div id="wlt_map_location" style="height:300px;width:100%;"></div>
  1153.  
  1154. <div class="well well-sm">
  1155. <b><?php echo $CORE->_e(array('add','46')); ?></b>
  1156. <?php echo $CORE->_e(array('add','47')); ?>: <span id="wlt_dcountry" class="label label-primary"><?php if(isset($_GET['eid']) && get_post_meta($_GET['eid'],'map-country',true) != ""){ echo get_post_meta($_GET['eid'],'map-country',true); }else{ echo '<i class="glyphicon glyphicon-remove"></i>'; } ?></span>
  1157. <?php echo $CORE->_e(array('add','48')); ?>: <span id="wlt_dstate" class="label label-primary"><?php if(isset($_GET['eid']) && get_post_meta($_GET['eid'],'map-state',true) != ""){ echo get_post_meta($_GET['eid'],'map-state',true); }else{ echo '<i class="glyphicon glyphicon-remove"></i>'; } ?></span>
  1158. <?php echo $CORE->_e(array('add','49')); ?>: <span id="wlt_dcity" class="label label-primary"><?php if(isset($_GET['eid']) && get_post_meta($_GET['eid'],'map-city',true) != ""){ echo get_post_meta($_GET['eid'],'map-city',true); }else{ echo '<i class="glyphicon glyphicon-remove"></i>'; } ?></span>
  1159. </div>
  1160. </div>
  1161.  
  1162. <input type="hidden" id="map-long" name="custom[map-log]" <?php if(isset($_GET['eid'])){ echo 'value="'.get_post_meta($_GET['eid'],'map-log',true).'"'; } ?>>
  1163. <input type="hidden" id="map-lat" name="custom[map-lat]" <?php if(isset($_GET['eid'])){ echo 'value="'.get_post_meta($_GET['eid'],'map-lat',true).'"'; } ?>>
  1164. <input type="hidden" id="map-country" name="custom[map-country]" <?php if(isset($_GET['eid'])){ echo 'value="'.get_post_meta($_GET['eid'],'map-country',true).'"'; } ?>>
  1165. <input type="hidden" id="map-address1" name="custom[map-address1]" <?php if(isset($_GET['eid'])){ echo 'value="'.get_post_meta($_GET['eid'],'map-address1',true).'"'; } ?>>
  1166. <input type="hidden" id="map-address2" name="custom[map-address2]" <?php if(isset($_GET['eid'])){ echo 'value="'.get_post_meta($_GET['eid'],'map-address2',true).'"'; } ?>>
  1167. <input type="hidden" id="map-address3" name="custom[map-address3]" <?php if(isset($_GET['eid'])){ echo 'value="'.get_post_meta($_GET['eid'],'map-address3',true).'"'; } ?>>
  1168. <input type="hidden" id="map-zip" name="custom[map-zip]" <?php if(isset($_GET['eid'])){ echo 'value="'.get_post_meta($_GET['eid'],'map-zip',true).'"'; } ?>>
  1169. <input type="hidden" id="map-state" name="custom[map-state]" <?php if(isset($_GET['eid'])){ echo 'value="'.get_post_meta($_GET['eid'],'map-state',true).'"'; } ?>>
  1170. <input type="hidden" id="map-city" name="custom[map-city]" <?php if(isset($_GET['eid'])){ echo 'value="'.get_post_meta($_GET['eid'],'map-city',true).'"'; } ?>>
  1171.  
  1172.  
  1173.  
  1174. <script type="text/javascript">
  1175.  
  1176. var geocoder;var map;var marker = ''; var markers = [];
  1177.  
  1178. function initialize() {
  1179.  
  1180. if(typeof(map) != "undefined"){ return; }
  1181.  
  1182. // GET DEFAULT LOCATION
  1183. <?php if(isset($_GET['eid']) && get_post_meta($_GET['eid'],'map-log',true) !=""){
  1184. $DF_LOCATON = get_post_meta($_GET['eid'],'map-lat',true).",".get_post_meta($_GET['eid'],'map-log',true);
  1185. }else{
  1186. $DF_LOCATON = $GLOBALS['CORE_THEME']['google_coords'];
  1187. }
  1188.  
  1189. if($DF_LOCATON == ""){ $DF_LOCATON ="0,0"; }
  1190. $DF_ZOOM = $GLOBALS['CORE_THEME']['google_zoom'];
  1191. if($DF_ZOOM == ""){ $DF_ZOOM = "5"; }
  1192. ?>
  1193.  
  1194. // CREATE MAP CANVUS
  1195. var myOptions = {mapTypeId: google.maps.MapTypeId.ROADMAP, zoomControl: true, scaleControl: true }
  1196. map = new google.maps.Map(document.getElementById("wlt_map_location"), myOptions);
  1197.  
  1198. // LOAD MAP LOCATIONS
  1199. var defaultBounds = new google.maps.LatLngBounds(
  1200. new google.maps.LatLng(<?php echo $DF_LOCATON; ?>) );
  1201. map.fitBounds(defaultBounds);
  1202.  
  1203. // ADD ON MARKER
  1204. <?php if(isset($_GET['eid']) && get_post_meta($_GET['eid'],'map-log',true) !=""){ ?>
  1205. var marker = new google.maps.Marker({
  1206. position: new google.maps.LatLng(<?php echo get_post_meta($_GET['eid'],'map-lat',true); ?>,<?php echo get_post_meta($_GET['eid'],'map-log',true); ?>),
  1207. map: map,
  1208. animation: google.maps.Animation.DROP,
  1209. icon: new google.maps.MarkerImage('<?php echo get_template_directory_uri(); ?>/framework/img/map/icon.png'),
  1210. });
  1211. <?php } ?>
  1212.  
  1213. // ADD SEARCH BOX
  1214. map.controls[google.maps.ControlPosition.TOP_LEFT].push(document.getElementById('form_map_location'));
  1215. var searchBox = new google.maps.places.SearchBox(document.getElementById('form_map_location'));
  1216.  
  1217. // EVENT
  1218. google.maps.event.addListener(searchBox, 'places_changed', function() {
  1219. var places = searchBox.getPlaces();
  1220.  
  1221. if (places.length == 0) {
  1222. return;
  1223. }
  1224. for (var i = 0, marker; marker = markers[i]; i++) {
  1225. marker.setMap(null);
  1226. }
  1227.  
  1228. // For each place, get the icon, place name, and location.
  1229. var bounds = new google.maps.LatLngBounds();
  1230. for (var i = 0, place; place = places[i]; i++) {
  1231. var image = {
  1232. url: place.icon,
  1233. size: new google.maps.Size(71, 71),
  1234. origin: new google.maps.Point(0, 0),
  1235. anchor: new google.maps.Point(17, 34),
  1236. scaledSize: new google.maps.Size(25, 25)
  1237. };
  1238.  
  1239.  
  1240. addMarker(place.geometry.location);
  1241. document.getElementById("map-long").value = place.geometry.location.lng();
  1242. document.getElementById("map-lat").value = place.geometry.location.lat();
  1243. getMyAddress(place.geometry.location,true)
  1244.  
  1245. bounds.extend(place.geometry.location);
  1246. }
  1247.  
  1248. map.fitBounds(bounds);
  1249. map.setZoom(12);
  1250. });
  1251.  
  1252. // EVENT
  1253. google.maps.event.addListener(map, 'bounds_changed', function() {
  1254. var bounds = map.getBounds();
  1255. searchBox.setBounds(bounds);
  1256.  
  1257. });
  1258.  
  1259. // EVENT
  1260. google.maps.event.addListener(map, 'click', function(event){
  1261. document.getElementById("map-long").value = event.latLng.lng();
  1262. document.getElementById("map-lat").value = event.latLng.lat();
  1263. getMyAddress(event.latLng,"yes");
  1264. addMarker(event.latLng);
  1265. });
  1266.  
  1267. // DEFAULT ZOOM LEVEL
  1268. var listener = google.maps.event.addListener(map, "idle", function() {
  1269. if (map.getZoom() != <?php echo $DF_ZOOM; ?>){ map.setZoom(<?php echo $DF_ZOOM; ?>); }
  1270. google.maps.event.removeListener(listener);
  1271. });
  1272.  
  1273. } // END INIT
  1274.  
  1275.  
  1276. jQuery("#form_map_location").focusout(function() {
  1277. setTimeout(function(){ getMapLocation(jQuery("#form_map_location").val()); }, 500);
  1278.  
  1279.  
  1280. });
  1281.  
  1282. function getMapLocation(location){
  1283. document.getElementById("map-state").value = "";
  1284. var geocoder = new google.maps.Geocoder();
  1285. if (geocoder) { geocoder.geocode({"address": location}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) {
  1286.  
  1287. map.setCenter(results[0].geometry.location);
  1288. addMarker(results[0].geometry.location);
  1289. getMyAddress(results[0].geometry.location,"no");
  1290. document.getElementById("map-long").value = results[0].geometry.location.lng();
  1291. document.getElementById("map-lat").value = results[0].geometry.location.lat();
  1292. map.setZoom(<?php $default_zoom = $GLOBALS['CORE_THEME']['google_zoom']; if($default_zoom == ""){ $default_zoom = "9"; } echo $default_zoom; ?>);
  1293. }});}
  1294. }
  1295.  
  1296. function getMyAddress(location,setaddress){
  1297.  
  1298. jQuery('#showmapbox').show();
  1299. google.maps.event.trigger(map, 'resize');
  1300. var geocoder = new google.maps.Geocoder();
  1301. var country = "";
  1302. if (geocoder) {geocoder.geocode({"latLng": location}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) {
  1303.  
  1304. for (var i = 0; i < results[0].address_components.length; i++) {
  1305.  
  1306. var addr = results[0].address_components[i];
  1307. //alert(addr.types[0]);
  1308. switch (addr.types[0]){
  1309.  
  1310. case "street_number": {
  1311. document.getElementById("map-address1").value = addr.long_name;
  1312. } break;
  1313.  
  1314. case "route": {
  1315. document.getElementById("map-address2").value = addr.long_name;
  1316. } break;
  1317.  
  1318. case "locality":
  1319. case "postal_town":
  1320. {
  1321. document.getElementById("map-address3").value = addr.long_name;
  1322. document.getElementById("map-city").value = addr.long_name;
  1323. } break;
  1324.  
  1325. case "postal_code": {
  1326. document.getElementById("map-zip").value = addr.short_name;
  1327. } break;
  1328.  
  1329. case "administrative_area_level_1": {
  1330. document.getElementById("map-state").value = addr.long_name;
  1331. } break;
  1332.  
  1333. case "administrative_area_level_2": {
  1334. document.getElementById("map-state").value = addr.long_name;
  1335. } break;
  1336.  
  1337. case "administrative_area_level_3": {
  1338. document.getElementById("map-state").value = document.getElementById("map-state").value + addr.long_name;
  1339. } break;
  1340.  
  1341. case "country": {
  1342. document.getElementById("map-country").value = addr.short_name;
  1343. } break;
  1344.  
  1345. } // end switch
  1346.  
  1347. } // end for
  1348.  
  1349. // NOW SET THE DISPLAY VALUES
  1350. jQuery('#wlt_dcity').html(document.getElementById("map-city").value);
  1351. jQuery('#wlt_dstate').html(document.getElementById("map-state").value);
  1352. jQuery('#wlt_dcountry').html(document.getElementById("map-country").value);
  1353.  
  1354. if(setaddress == "yes"){
  1355. document.getElementById("form_map_location").value = results[0].formatted_address;
  1356. }
  1357.  
  1358. map.setCenter(results[0].geometry.location);
  1359. map.setZoom(15);
  1360.  
  1361. } }); }}
  1362.  
  1363.  
  1364. function addMarker(location) {
  1365. if (marker=='') {
  1366.  
  1367.  
  1368. marker = new google.maps.Marker({ position: location, map: map, draggable:true, animation: google.maps.Animation.DROP, });
  1369.  
  1370.  
  1371. google.maps.event.addListener (marker, 'dragend', function (event){
  1372. document.getElementById("map-long").value = event.latLng.lng();
  1373. document.getElementById("map-lat").value = event.latLng.lat();
  1374. getMyAddress(event.latLng,"yes");
  1375. addMarker(event.latLng);
  1376. });
  1377.  
  1378.  
  1379. }
  1380. marker.setPosition(location);
  1381. map.setCenter(location);
  1382. }
  1383.  
  1384.  
  1385. // LOAD MAP BOX
  1386. jQuery(document).ready(function() {
  1387. jQuery( ".mapboxlink" ).click(function() {
  1388. setTimeout(function(){ initialize(); }, 1000);
  1389. });
  1390. });
  1391. </script>
  1392.  
  1393.  
  1394. <?php } break;
  1395.  
  1396.  
  1397. default: {
  1398.  
  1399. hook_add_listdata($k);
  1400.  
  1401. } break;
  1402.  
  1403. } ?>
  1404.  
  1405. </div>
  1406. </div>
  1407.  
  1408. </div>
  1409. <!--- STEP <?php echo $k; ?> --->
  1410. <?php $i++; } ?>
  1411.  
  1412. </form> <!-- END STEPS FORM DATA -->
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425. <?php
  1426.  
  1427. if(isset($_GET['eid'])){
  1428. // GET EXISTING UPLOAD COUNT
  1429. $EXISTING_UPLOAD_COUNT = $CORE->UPLOADSPACE($_GET['eid']);
  1430.  
  1431.  
  1432. if(
  1433. (isset($_GET['mediaonly']) && current_user_can( 'edit_user', $userdata->ID )) ||
  1434. ( isset($_POST['packageID']) && ( $packagefields[$_POST['packageID']]['multiple_images'] == "1" || ( ( count($packagefields) == 0 || count($packagefields) == 1 ) && $GLOBALS['CORE_THEME']['default_submission_fileuploads'] > 0) ) ) ||
  1435. ( !isset($_POST['packageID']) && $GLOBALS['CORE_THEME']['default_submission_fileuploads'] > 0 )
  1436. ){
  1437.  
  1438.  
  1439.  
  1440. // QUICK FIX FOR ADIN UPLOADING
  1441. if( isset($_GET['mediaonly']) && current_user_can( 'edit_user', $userdata->ID) ){ $GLOBALS['default_upload_space'] = 100; }
  1442. // CHECK THE USER HASNT ALREADY UPLOADED 1 IMAGE AS PART OF THE DEFAULT UPLOAD FORM
  1443. if($GLOBALS['default_upload_space'] == 1 && $EXISTING_UPLOAD_COUNT == 0 && !isset($_GET['eid'])){ /* blank me */ }else{
  1444. ?>
  1445.  
  1446. <?php do_action('hook_add_before_media'); ?>
  1447.  
  1448. <div class="panel panel-default"><div class="panel-heading"><h4 class="panel-title"> <span class="step-number"><?php echo $i; ?></span>
  1449. <a href="#step<?php echo $i; ?>" class="astep<?php echo $i; ?>" data-parent="#wlt_stepswizard" data-toggle="collapse">
  1450. <?php echo $CORE->_e(array('add','65')); ?> (<?php echo $EXISTING_UPLOAD_COUNT."/".$GLOBALS['default_upload_space']; ?>)</h4>
  1451. </a>
  1452. </div>
  1453. <div id="step<?php echo $i; ?>" class="stepblockmedia panel-collapse collapse <?php if(isset($_GET['mediaonly'])){ echo "in"; } ?>"><div class="panel-body">
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460. <form id="fileupload" action="<?php echo get_home_url(); ?>/index.php" method="POST" enctype="multipart/form-data">
  1461. <?php if($EXISTING_UPLOAD_COUNT < $GLOBALS['default_upload_space']){ ?>
  1462. <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
  1463. <div class="fileupload-buttonbar">
  1464.  
  1465. <button type="button" class="btn btn-primary start pull-right">
  1466. <i class="glyphicon glyphicon-upload glyphicon glyphicon-white"></i>
  1467. <span><?php echo $CORE->_e(array('add','19')); ?></span>
  1468. </button>
  1469.  
  1470. <!-- The fileinput-button span is used to style the file input field as button -->
  1471. <span class="btn btn-success fileinput-button">
  1472. <i class="glyphicon glyphicon-plus glyphicon glyphicon-white"></i>
  1473. <span><?php echo $CORE->_e(array('add','18')); ?></span>
  1474. <input type="file" name="files[]" multiple >
  1475. </span>
  1476.  
  1477.  
  1478. </div>
  1479. <div class="col-md-12">
  1480. <!-- The global progress information -->
  1481. <div class="span5 fileupload-progress fade" style="margin-top:20px;">
  1482. <!-- The global progress bar -->
  1483. <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
  1484. <div class="bar progress-bar progress-bar-success" style="width:0%;"></div>
  1485. </div>
  1486. <!-- The extended global progress information -->
  1487. <div class="progress-extended">&nbsp;</div>
  1488. </div>
  1489. </div>
  1490. <!-- The loading indicator is shown during file processing -->
  1491. <div class="fileupload-loading"></div>
  1492. <br>
  1493. <?php } ?>
  1494. <!-- The table listing the files available for upload/download -->
  1495. <table role="presentation" class="table">
  1496. <tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery">
  1497.  
  1498. <tr class="template-download fade in">
  1499.  
  1500. <?php echo $CORE->UPLOAD_GET($_GET['eid'],1,"all"); ?>
  1501.  
  1502. </tbody></table>
  1503. </form>
  1504.  
  1505.  
  1506. <hr />
  1507. <p><?php echo $CORE->_e(array('add','61')); ?></p>
  1508.  
  1509. </div><!-- end panel-body -->
  1510.  
  1511. </div></div>
  1512. <!-- END PANEL -->
  1513.  
  1514. <form method="post" action="<?php echo get_home_url(); ?>/index.php" target="core_delete_attachment_iframe" name="core_delete_attachment" id="core_delete_attachment">
  1515. <input type="hidden" name="core_delete_attachment" value="gogo" />
  1516. <input type="hidden" id="attachement_id" name="attachement_id" value="" />
  1517. </form>
  1518. <iframe frameborder="0" style="display:none;" scrolling="auto" name="core_delete_attachment_iframe" id="core_delete_attachment_iframe"></iframe>
  1519. <!-- The template to display files available for upload -->
  1520. <script id="template-upload" type="text/x-tmpl">
  1521. {% for (var i=0, file; file=o.files[i]; i++) { %}
  1522. <tr class="template-upload fade">
  1523. <td class="preview"><span class="fade"></span></td>
  1524. <td class="name" style="max-width:200px;overflow:hidden;"><span>{%=file.name%}</span></td>
  1525. <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
  1526. {% if (file.error) { %}
  1527. <td class="error" colspan="2"><span class="label label-warning">Error</span> {%=file.error%}</td>
  1528. {% } else if (o.files.valid && !i) { %}
  1529. <td>
  1530. <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar progress-bar progress-bar-info" style="width:0%;"></div></div>
  1531. </td>
  1532. <td class="start">{% if (!o.options.autoUpload) { %}
  1533. <button class="btn btn-primary">
  1534. <i class="glyphicon glyphicon-upload glyphicon glyphicon-white"></i>
  1535. <span><?php echo $CORE->_e(array('add','20')); ?></span>
  1536. </button>
  1537. {% } %}</td>
  1538. {% } else { %}
  1539. <td colspan="2"></td>
  1540. {% } %}
  1541. <td class="cancel">{% if (!i) { %}
  1542. <button class="btn btn-warning">
  1543. <i class="glyphicon glyphicon-ban-circle glyphicon glyphicon-white"></i>
  1544. </button>
  1545. {% } %}</td>
  1546. </tr>
  1547. {% } %}
  1548. </script>
  1549. <!-- The template to display files available for download -->
  1550. <script id="template-download" type="text/x-tmpl">
  1551. {% for (var i=0, file; file=o.files[i]; i++) { %}
  1552. <tr class="template-download fade {%=file.aid%}bb">
  1553. {% if (file.error) { %}
  1554. <td></td>
  1555. <td class="name" style="max-width:200px;overflow:hidden;"><span>{%=file.name%}</span></td>
  1556. <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
  1557. <td class="error" colspan="2"><span class="label label-important"><?php echo $CORE->_e(array('add','22')); ?></span> {%=file.error%}</td>
  1558. {% } else { %}
  1559. <td class="preview">{% if (file.thumbnail_url) { %}
  1560. <a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img class="img-polaroid" style="max-width:150px;max-height:150px;" src="{%=file.thumbnail_url%}"></a>
  1561. {% } %}</td>
  1562. <td class="name" style="max-width: 200px;overflow: hidden;">
  1563.  
  1564. <input type="text" value="{%=file.name%}" onchange="WLTSetImgText('<?php echo str_replace("http://","",get_home_url()); ?>', '{%=file.aid%}', this.value, 'core_ajax_callback');" class="form-input col-md-12" />
  1565.  
  1566. <div class="clearfix"></div>
  1567.  
  1568. </td>
  1569.  
  1570. <td colspan="2">
  1571.  
  1572. <input type="text" style="width:30px;text-align:center;" value="0"
  1573. class="wlt_popover"
  1574. rel="popover"
  1575. data-placement="top"
  1576. data-original-title="<?php echo $CORE->_e(array('add','74','flag_noedit')); ?>"
  1577. data-trigger="hover" onchange="WLTSetImgOrder('<?php echo str_replace("http://","",get_home_url()); ?>', '{%=file.aid%}', '<?php echo $_GET['eid']; ?>', this.value, 'core_ajax_callback');">
  1578. </td>
  1579.  
  1580.  
  1581. {% } %}
  1582. <td >
  1583.  
  1584. <button class="btn btn-warning" onclick="WLTSetFeatured('<?php echo str_replace("http://","",get_home_url()); ?>', '<?php echo $_GET['eid']; ?>', '{%=file.aid%}', 'core_ajax_callback'); jQuery('.{%=file.aid%}bb').addClass('bs-callout');jQuery(this).hide();return false;" title="<?php echo $CORE->_e(array('add','68')); ?>">
  1585. <i class="glyphicon glyphicon-star icon-white"></i>
  1586. </button>
  1587. </td>
  1588. <td class="delete">
  1589. <button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}"{% if (file.delete_with_credentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
  1590. <i class="glyphicon glyphicon-trash glyphicon glyphicon-white"></i>
  1591. </button>
  1592.  
  1593. </td>
  1594. </tr>
  1595. {% } %}
  1596. </script>
  1597. <script>
  1598. jQuery(function () {
  1599. // Initialize the jQuery File Upload widget:
  1600. jQuery('#fileupload').fileupload({
  1601. url: '<?php echo get_home_url(); ?>/index.php',
  1602. type: 'POST',
  1603. paramName: 'core_attachments',
  1604. fileTypes: '/^image\/(gif|jpeg|png)$/',
  1605. formData: { name: 'core_post_id', value: <?php echo $_GET['eid']; ?> },
  1606. maxNumberOfFiles: <?php echo $GLOBALS['default_upload_space']-$EXISTING_UPLOAD_COUNT; ?>
  1607.  
  1608. });
  1609. jQuery('#fileupload').bind('fileuploaddestroy', function (e, data) {
  1610. document.getElementById('attachement_id').value= data.url;
  1611. document.core_delete_attachment.submit();
  1612. });
  1613.  
  1614. });
  1615. </script>
  1616. <script src="<?php echo FRAMREWORK_URI; ?>js/up/vendor/jquery.ui.widget.js" type="text/javascript"></script>
  1617. <script src="<?php echo FRAMREWORK_URI; ?>js/up/tmpl.min.js" type="text/javascript"></script>
  1618. <script src="<?php echo FRAMREWORK_URI; ?>js/up/load-image.min.js" type="text/javascript"></script>
  1619. <script src="<?php echo FRAMREWORK_URI; ?>js/up/canvas-to-blob.min.js" type="text/javascript"></script>
  1620. <script src="<?php echo FRAMREWORK_URI; ?>js/up/jquery.iframe-transport.js" type="text/javascript"></script>
  1621. <script src="<?php echo FRAMREWORK_URI; ?>js/up/jquery.fileupload.js" type="text/javascript"></script>
  1622. <script src="<?php echo FRAMREWORK_URI; ?>js/up/jquery.fileupload-fp.js" type="text/javascript"></script>
  1623. <script src="<?php echo FRAMREWORK_URI; ?>js/up/jquery.fileupload-ui.js" type="text/javascript"></script>
  1624. <script src="<?php echo FRAMREWORK_URI; ?>js/up/main.js" type="text/javascript"></script>
  1625. <!--[if gte IE 8]><script src="<?php echo FRAMREWORK_URI; ?>js/up/cors/jquery.xdr-transport.js"></script><![endif]-->
  1626. <?php } } }// end media box ?>
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632. <?php
  1633.  
  1634.  
  1635. // SAVE BUTTONS
  1636. if(!isset($_GET['mediaonly'])){ ?>
  1637.  
  1638.  
  1639.  
  1640. <?php do_action('hook_add_form_abovebutton'); /* HOOK */ ?>
  1641.  
  1642. <hr />
  1643.  
  1644. <?php if(isset($_GET['eid'])){ $elink = get_permalink($_GET['eid']); }else{ $elink = $GLOBALS['CORE_THEME']['links']['add']; } ?>
  1645. <a class="btn btn-default pull-right" href="<?php echo $elink; ?>"><?php echo $CORE->_e(array('button','8')); ?></a>
  1646. <button class="btn btn-primary" type="submit" id="MainSaveBtn"><?php echo $CORE->_e(array('add','16')); ?></button>
  1647.  
  1648. <?php } ?>
  1649.  
  1650. <hr />
  1651.  
  1652. <div id="annonce">
  1653.  
  1654. <div class="panel panel-default" style="margin-top:20px;">
  1655. <div class="panel-heading">
  1656. <h4 class="panel-title">
  1657. <span class="step-number">6</span>
  1658. <a class="astep2 " data-toggle="collapse" data-parent="#wlt_stepswizard" href="#step6">Publier une annonce</a>
  1659. </h4>
  1660. </div>
  1661. </div>
  1662.  
  1663. <div class="panel panel-body" style="margin-bottom:20px;">
  1664. <div class="col-lg-6">
  1665. <h4 style="text-align:center;">Vous désirez<br />publier une offre d'emploi ?</h4>
  1666. <div class="publish" style="text-align:center;">
  1667. <a href="http://annuaire-pro-rotarien.org/publier-un-poste/" class="btn btn-primary">Publier</a>
  1668. </div>
  1669. </div>
  1670. <div class="col-lg-6">
  1671. <h4 style="text-align:center;">Vous désirez<br />publier une annonce ?</h4>
  1672. <div class="publish" style="text-align:center;">
  1673. <a href="http://annuaire-pro-rotarien.org/adverts/add/" class="btn btn-primary">Publier</a>
  1674. </div>
  1675. </div>
  1676. </div>
  1677.  
  1678. </div>
  1679.  
  1680. </div>
  1681.  
  1682.  
  1683. <?php do_action('hook_add_form_bottom'); /* HOOK */ ?>
  1684.  
  1685.  
  1686. </div> </div> <!-- end row -->
  1687. <div class="clearfix"></div>
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693. <?php do_action('hook_add_after'); ?>
  1694.  
  1695.  
  1696. <?php } ?>
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707. <script type="application/javascript">
  1708.  
  1709. function colAll(){
  1710. jQuery('#step1').removeClass("in");
  1711. jQuery('#step2').removeClass("in");
  1712. jQuery('#step3').removeClass("in");
  1713. jQuery('#step4').removeClass("in");
  1714. jQuery('#step5').removeClass("in");
  1715. jQuery('#step6').removeClass("in");
  1716. }
  1717. function VALIDATE_FORM_DATA(){
  1718.  
  1719. // USER REGISTRATION VALIDATION
  1720. <?php if(!$userdata->ID){ ?>
  1721. var de4 = document.getElementById("form_email");
  1722. if(de4.value == ''){
  1723. alert('<?php echo $CORE->_e(array('validate','0')); ?>');
  1724. de4.style.border = 'thin solid red';
  1725. de4.focus();
  1726. colAll(); jQuery('.stepblock1').collapse('show');
  1727. return false;
  1728. }
  1729. if( !isValidEmail( de4.value ) ) {
  1730. alert('<?php echo $CORE->_e(array('validate','23')); ?>');
  1731. de4.style.border = 'thin solid blue';
  1732. de4.focus();
  1733. colAll(); jQuery('.stepblock1').collapse('show');
  1734. return false;
  1735. }
  1736. var de42 = document.getElementById("form_new_username");
  1737. if(de42.value == ''){
  1738. alert('<?php echo $CORE->_e(array('validate','0')); ?>');
  1739. de42.style.border = 'thin solid red';
  1740. de42.focus();
  1741. colAll(); jQuery('.stepblock1').collapse('show');
  1742. return false;
  1743. }
  1744.  
  1745. <?php } ?>
  1746.  
  1747. // CATEGORY SELECTION
  1748. if(jQuery('.stepblock3').find(":checkbox:checked").length == 0){
  1749. alert('<?php echo $CORE->_e(array('validate','0')); ?>');
  1750. colAll(); jQuery('.stepblock3').collapse('show');
  1751. return false;
  1752. }
  1753.  
  1754. // IMAGE UPLOADS
  1755. <?php if($GLOBALS['default_upload_space'] > 0 && $GLOBALS['CORE_THEME']['require_image'] == 1){ ?>
  1756. var de1 = document.getElementById("fileupload");
  1757. if(de1.value == ''){
  1758. alert('<?php echo $CORE->_e(array('validate','27')); ?>');
  1759. de1.style.border = 'thin solid red';
  1760. de1.focus();
  1761. <?php if(isset($_GET['eid'])){ ?>
  1762. colAll(); jQuery('.stepblockmedia').collapse('show');
  1763. <?php }else{ ?>
  1764. colAll(); jQuery('.stepblock4').collapse('show');
  1765. <?php } ?>
  1766. return false;
  1767. }
  1768. <?php } ?>
  1769.  
  1770. // LISTING DESCRIPTION VALIDATION
  1771. var de1 = document.getElementById("form_post_title");
  1772. if(de1.value == ''){
  1773. alert('<?php echo $CORE->_e(array('validate','0')); ?>');
  1774. de1.style.border = 'thin solid red';
  1775. de1.focus();
  1776. colAll(); jQuery('.stepblock2').collapse('show');
  1777. return false;
  1778. }
  1779.  
  1780. <?php if( (isset($_GET['eid']) && get_post_meta($_GET['eid'],'html',true) == "yes" ) || ( isset($_POST['packageID']) && isset($packagefields[$_POST['packageID']]['enhancement']) && $packagefields[$_POST['packageID']]['enhancement']['3'] == 1 ) ){ ?>
  1781.  
  1782. <?php }else{ ?>
  1783. var de3 = document.getElementById("form_post_content");
  1784. if(de3.value == ''){
  1785. alert('<?php echo $CORE->_e(array('validate','0')); ?>');
  1786. de3.style.border = 'thin solid red';
  1787. de3.focus();
  1788. colAll(); jQuery('.stepblock2').collapse('show');
  1789. return false;
  1790. }
  1791. <?php } ?>
  1792. <?php
  1793.  
  1794. /*** GOOGLE MAP ***/
  1795.  
  1796. if(isset($GLOBALS['CORE_THEME']['google_required']) && $GLOBALS['CORE_THEME']['google_required'] == 1){ ?>
  1797.  
  1798. // CHECK IF THE COUNTRY FORM HAS A VALUE LONG/LATE VALUE
  1799. //if(document.getElementById("map-long").value == ""){
  1800. //getMapLocation(jQuery('#form_map_location').val());
  1801. // return false;
  1802. //}
  1803.  
  1804. var de4 = document.getElementById("form_map_location");
  1805. if(de4.value == ''){
  1806. alert('<?php echo $CORE->_e(array('add','51')); ?>');
  1807. de4.style.border = 'thin solid red';
  1808. colAll(); jQuery('.stepblock6').collapse('show');
  1809. initialize();
  1810. return false;
  1811. }
  1812. <?php } ?>
  1813.  
  1814. jQuery('html,body').scrollTop(0);
  1815.  
  1816. // VALIDATE CUSTOM FIELDS
  1817. return ValidateCoreRegFields();
  1818.  
  1819.  
  1820. }
  1821. </script>
  1822.  
  1823.  
  1824. <script type="text/javascript" src="<?php echo FRAMREWORK_URI; ?>js/nicEdit.js"></script>
  1825. <?php if( (isset($_GET['eid']) && get_post_meta($_GET['eid'],'html',true) == "yes" ) || ( isset($_POST['packageID']) && isset($packagefields[$_POST['packageID']]['enhancement']) && $packagefields[$_POST['packageID']]['enhancement']['3'] == 1) ){ ?>
  1826. <script type="application/javascript">
  1827. jQuery(document).ready(function() { toggleHTML(); });
  1828. </script>
  1829. <?php } ?>
  1830.  
  1831.  
  1832. <script type="application/javascript">
  1833.  
  1834.  
  1835. function listingenhancement(id,price){
  1836.  
  1837. // DISABLE CHECK
  1838. jQuery("#"+id).attr("disabled", true);
  1839.  
  1840. // CURRENT PRICE
  1841. var current_amount_total = jQuery("#listingprice").text();
  1842.  
  1843. var current_amount_total = current_amount_total.replace(".", "");
  1844. //var current_amount_total = current_amount_total.replace(".", "");
  1845. var current_amount_total = current_amount_total.replace(",", "");
  1846.  
  1847. // WORK OUT PRICES
  1848. if(document.getElementById(id).checked == true){
  1849. newtotal = parseFloat(current_amount_total)+price;
  1850. }else{
  1851. newtotal = parseFloat(current_amount_total)-price;
  1852. }
  1853. newtotal = Math.round(newtotal*100)/100;
  1854. newtotal = newtotal.toFixed(2);
  1855. jQuery("#listingprice").text(newtotal);
  1856.  
  1857.  
  1858. if(id == 'exh3'){
  1859. toggleHTML();
  1860. }
  1861.  
  1862. // REMOVE DISABLE
  1863. setTimeout(function(){ jQuery("#"+id).removeAttr("disabled"); }, 1000);
  1864.  
  1865.  
  1866. }
  1867. var area1, htmlenabled;
  1868. function toggleHTML() {
  1869.  
  1870. if(!area1) {
  1871.  
  1872. area1 = new nicEditor({ buttonList : ['bold','italic',
  1873. 'underline',
  1874. 'left',
  1875. 'center',
  1876. 'right',
  1877. 'justify',
  1878. 'ol',
  1879. 'ul',
  1880. 'strikethrough',
  1881. 'removeformat',
  1882. 'indent',
  1883. 'outdent',
  1884. 'hr',
  1885. 'image',
  1886. 'forecolor',
  1887. 'bgcolor',
  1888. 'link' ,
  1889. 'unlink' ,
  1890. 'fontSize',
  1891. 'fontFamily',
  1892. 'fontFormat']}).panelInstance('form_post_content',{hasPanel : true});
  1893.  
  1894. htmlenabled = true;
  1895.  
  1896.  
  1897.  
  1898. } else {
  1899. // REMOVE
  1900. area1.removeInstance('form_post_content');
  1901. area1 = null;
  1902.  
  1903. // STRIP HTML TAGS
  1904. var html = jQuery("#form_post_content").text();
  1905. var div = document.createElement("div");
  1906. jQuery("#form_post_content").innerHTML = div;
  1907.  
  1908. }
  1909. }
  1910.  
  1911.  
  1912. jQuery(document).ready(function(){
  1913.  
  1914. jQuery('.astep2, .astep1').live('click', function(e) {
  1915. if(htmlenabled) { toggleHTML(); toggleHTML(); }
  1916. });
  1917. });
  1918.  
  1919. </script>
  1920.  
  1921. <script type="application/javascript">jQuery('video,audio').mediaelementplayer({audioWidth: 150});</script>
  1922.  
  1923.  
  1924. <?php if(isset($_GET['eid'])){ ?>
  1925. <form action="<?php echo $GLOBALS['CORE_THEME']['links']['add']; ?>?eid=<?php echo $_GET['eid']; ?>" method="post" name="renewalfree" id="renewalfree">
  1926. <input type="hidden" value="renewalfree" name="action"><input type="hidden" value="<?php echo $_GET['eid']; ?>" name="pid">
  1927. </form>
  1928.  
  1929. <?php $can_show_hitcounter = get_post_meta($_GET['eid'],'visitorcounter',true); if($can_show_hitcounter == "yes"){ ?>
  1930. <hr />
  1931. <?php echo do_shortcode('[VISITORCHART postid="'.$_GET['eid'].'"]'); ?>
  1932. <?php } } ?>
  1933.  
  1934.  
  1935.  
  1936. <?php get_footer($CORE->pageswitch());
  1937.  
  1938. /* =============================================================================
  1939. -- END FILE
  1940. ========================================================================== */
  1941. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement