Exemplo n.º 1
0
 function old__construct($section = 'profile')
 {
     global $path_site;
     global $meta_desc;
     global $meta_addtl;
     global $meta_keywords;
     global $title;
     global $_REQUEST;
     global $states;
     global $ccExpMM;
     global $ccExpYY;
     global $cl;
     global $profnav;
     @($method = $_REQUEST['method']);
     @($action = $_REQUEST['action']);
     @($call = $_REQUEST['call']);
     // a call is an ajax call.
     // SETUP PAGE OUTPUT VARIABLES START \\
     $returnmsg = NULL;
     $disabled = NULL;
     $returnmsg_addAddr = NULL;
     $contentOutput = NULL;
     // PROFILE HOME \\
     if ($section == 'profile') {
         // PROF LEFT NAV ACTIVE START \\
         $profnav['acctinfo'] = 'active';
         // PROF LEFT NAV ACTIVE END \\
         if (!isset($_SESSION['user']['id'])) {
             redirect($path_site . 'profile/login.php');
         }
         // INIT OBJECTS \\
         $returnmsg_prof = NULL;
         if (isset($_REQUEST['submitupdate'])) {
             // check for errors
             if ($errors = $this->checkProfile($_REQUEST)) {
                 $returnmsg_prof = replace_output(ERROR_PROFILE2, array('errors' => $errors));
             } else {
                 // no errors, Login user and start session.
                 if ($this->submitUser($_REQUEST, 'profile')) {
                     // move user back to last
                     $returnmsg_prof = CONF_MSG_1;
                     unset($_REQUEST);
                 } else {
                     $returnmsg_prof = ERROR_MSG_CONTACT2;
                 }
             }
         }
         // Get Profile Information
         $info = get_profile($_SESSION['user']['id']);
         // check if newsletter is selected.
         @($info['agreeNewsletter'] == 1) ? $data_nl = ' checked="checked"' : ($data_nl = NULL);
         $txtStates = NULL;
         $addStates = NULL;
         foreach ($states as $key => $value) {
             $sel = NULL;
             $selAdd = NULL;
             if (stripslashes($info['state']) == $key) {
                 $sel = ' selected="selected"';
             }
             if (@$_REQUEST['addState'] == $key) {
                 $selAdd = ' selected="selected"';
             }
             $txtStates .= '<option value="' . $key . '"' . $sel . '>' . $value . '</option>';
             $addStates .= '<option value="' . $key . '"' . $selAdd . '>' . $value . '</option>';
         }
         // CALL CONTENT AND REPLACE TAGS INSIDE
         $content = $path_site . 'inc/cb/acctProfile.inc';
         $returnOutput = new main_output($content);
         // replace tags from template
         @$returnOutput->replace_tags(array('path_site' => $path_site, 'return_msg' => $returnmsg_prof, 'data_un' => stripslashes($info['username']), 'data_em' => stripslashes($info['email']), 'data_fn' => stripslashes($info['firstName']), 'data_mi' => stripslashes($info['mi']), 'data_ln' => stripslashes($info['lastName']), 'data_addr1' => stripslashes($info['addr1']), 'data_addr2' => stripslashes($info['addr2']), 'data_city' => stripslashes($info['city']), 'states' => $txtStates, 'data_zc1' => substr(stripslashes($info['zip']), 0, 5), 'data_zc2' => substr(stripslashes($info['zip']), 5, 4), 'data_phone1' => substr(stripslashes($info['mainPhone']), 0, 3), 'data_phone2' => substr(stripslashes($info['mainPhone']), 3, 3), 'data_phone3' => substr(stripslashes($info['mainPhone']), 6, 4), 'data_phone4' => substr(stripslashes($info['altPhone']), 0, 3), 'data_phone5' => substr(stripslashes($info['altPhone']), 3, 3), 'data_phone6' => substr(stripslashes($info['altPhone']), 6, 4), 'data_nl' => $data_nl, 'site_baseurl' => SITE_BASEURL_SECURE));
         // Call the output
         $contentOutput .= $returnOutput->output;
         // GET TEMP HEADER
         $temp_notif_output = get_profile_notif();
         // CALL CONTENT AND REPLACE TAGS INSIDE
         $content = $path_site . 'inc/tpl/profile_body.inc';
         $returnOutput = new main_output($content);
         // replace tags from template
         @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'site_baseurl' => SITE_BASEURL_SECURE, 'return_msg' => $returnmsg, 'profile_nav' => $cl->compile_profileNav($profnav), 'box_four' => $temp_notif_output . replace_output(file_get_contents($path_site . 'inc/cb/box_four.inc'), array('path_site' => SITE_BASEURL_SECURE, 'header_style' => 'nav', 'list' => replace_output(HH_PM_PROF_NAV1, array('path_site' => SITE_BASEURL_SECURE)), 'content' => $contentOutput))));
         // Call the output
         $this->output .= $returnOutput->output;
     } else {
         if ($section == 'forgot') {
             // see if someone visits the registration page, but it already logged in, send them to thier profile homepage
             if (isset($_SESSION['user']['id'])) {
                 redirect($path_site . 'profile/');
             }
             // else, now check if they're registering or we're processing a registration.
             $returnmsg = NULL;
             if (isset($_REQUEST['submitforgot'])) {
                 // check for errors
                 if ($errors = $this->checkForgot($_REQUEST)) {
                     $returnmsg = replace_output(ERROR_PROFILE2, array('errors' => $errors));
                 } else {
                     // no errors, Login user and start session.
                     if ($this->submitUser($_REQUEST, 'forgot')) {
                         // move user back to last
                         $returnmsg = CONF_PROFILE_FORGOT1;
                         $meta_addtl .= replace_output(META_REDIRECT, array('path_site' => $path_site, 'secs' => '10'));
                         $disabled = ' disabled="disabled"';
                         unset($_REQUEST['email']);
                     } else {
                         $returnmsg = ERROR_PROFILE_FORGOT1;
                     }
                 }
             }
             // landing page for forgot
             // CALL CONTENT AND REPLACE TAGS INSIDE
             $content = $path_site . 'inc/cb/acctForgot.inc';
             $returnOutput = new main_output($content);
             // replace tags from template
             @$returnOutput->replace_tags(array('path_site' => $path_site, 'disabled' => $disabled, 'return_msg' => $returnmsg, 'data_em' => $_REQUEST['user_email']));
             // Call the output
             $this->output = $returnOutput->output;
         } else {
             if ($section == 'login') {
                 // SETUP PAGE OUTPUT VARIABLES START
                 # the response from reCAPTCHA
                 $resp = null;
                 # the error code from reCAPTCHA, if any
                 $error = null;
                 // see if someone visits the registration page, but it already logged in, send them to thier profile homepage
                 if (isset($_SESSION['user']['id'])) {
                     redirect($path_site . 'profile/');
                 }
                 // else, now check if they're registering or we're processing a registration.
                 $returnmsg = null;
                 if (isset($_REQUEST['submit_login'])) {
                     // check for errors
                     if ($errors = $this->checkLogin($_REQUEST)) {
                         $returnmsg = replace_output(ERROR_PROFILE1, array('errors' => $errors));
                     } else {
                         // no errors, Login user and start session.
                         if ($this->submitUser($_REQUEST, 'login')) {
                             // move user back to last
                             // print $last;
                             if (isset($_SESSION['last'])) {
                                 redirect($_SESSION['last']);
                             } else {
                                 redirect(SITE_BASEURL);
                             }
                             unset($_REQUEST, $_SESSION['last']);
                             exit;
                         } else {
                             $returnmsg = ERROR_EMAIL_VERIFICATION;
                         }
                     }
                 }
                 // CALL CONTENT AND REPLACE TAGS INSIDE
                 $content = $path_site . 'inc/cb/acctLogin.inc';
                 $returnOutput = new main_output($content);
                 // replace tags from template
                 @$returnOutput->replace_tags(array('path_site' => $path_site, 'return_msg' => $returnmsg, 'site_title' => SITE_TITLE, 'captcha' => recaptcha_get_html(CX_CAPTCHA_PUBLIC_KEY, $error, TRUE), 'data_un' => $_REQUEST['username']));
                 // Call the output
                 $contentOutput .= $returnOutput->output;
                 // CALL CONTENT AND REPLACE TAGS INSIDE
                 $content = $path_site . 'inc/cb/box_four.inc';
                 $returnOutput = new main_output($content);
                 // replace tags from template
                 @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'site_baseurl' => SITE_BASEURL_SECURE, 'return_msg' => $returnmsg, 'header_style' => 'banner', 'list' => replace_output(HH_PM_DHDR_LOGIN_NAV1, array('path_site' => SITE_BASEURL_SECURE)), 'content' => $contentOutput));
                 // Call the output
                 $this->output .= $returnOutput->output;
                 // CALL CONTENT AND REPLACE TAGS INSIDE
                 $content = $path_site . 'inc/cb/acctLogin_tip.inc';
                 $returnOutput = new main_output($content);
                 // replace tags from template
                 @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE));
                 // Call the output
                 $this->output2 .= $returnOutput->output;
             } else {
                 if ($section == 'logout') {
                     session_destroy();
                     redirect(SITE_BASEURL);
                 } else {
                     if ($section == 'register') {
                         // VERIFICATION
                         if (isset($_REQUEST['verify'])) {
                             if ($this->submitUser($_REQUEST, 'verify')) {
                                 redirect(SITE_BASEURL_SECURE . 'profile/');
                             } else {
                                 redirect(SITE_BASEURL_);
                             }
                         }
                         //CONFIRM
                         if ($action == 'confirm') {
                             if ($_SESSION['registration']['complete'] && $_SESSION['registration']['type'] == 'regular') {
                                 // CALL CONTENT AND REPLACE TAGS INSIDE
                                 $content = $path_site . 'inc/cb/acctRegister_confirm.inc';
                                 $returnOutput = new main_output($content);
                                 // replace tags from template
                                 @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'returnmsg' => $returnmsg));
                                 // Call the output
                                 $contentOutput .= $returnOutput->output;
                                 unset($_SESSION['registration']);
                             } else {
                                 redirect(SITE_BASEURL_SECURE . 'profile/');
                             }
                         } else {
                             // see if someone visits the registration page, but it already logged in, send them to thier profile homepage
                             if (isset($_SESSION['user']['id'])) {
                                 redirect($path_site . 'profile/');
                             }
                             // SETUP PAGE OUTPUT VARIABLES START
                             # the response from reCAPTCHA
                             $resp = null;
                             # the error code from reCAPTCHA, if any
                             $error = null;
                             isset($_REQUEST['agree']) && $_REQUEST['agree'] == '1' ? $data_ag = ' checked="checked"' : ($data_ag = null);
                             // (isset($_REQUEST['newsletter']) and $_REQUEST['newsletter'] == '1')? $data_nl=' checked="checked"' : $data_nl=NULL ;
                             // SETUP PAGE OUTPUT VARIABLES END
                             // Check if they're registering or we're processing a registration.
                             if (isset($_REQUEST['submit'])) {
                                 // check for errors
                                 $errors = $this->checkReg($_REQUEST);
                                 if ($errors) {
                                     $returnmsg = replace_output(ERROR_PROFILE1, array('errors' => $errors));
                                 } else {
                                     // no errors, add user to database, and start session.
                                     if ($this->submitUser($_REQUEST, 'reg')) {
                                         $_SESSION['registration']['complete'] = TRUE;
                                         $_SESSION['registration']['type'] = 'regular';
                                         unset($_REQUEST);
                                         redirect(SITE_BASEURL_SECURE . 'profile/register.php?action=confirm');
                                         exit;
                                     } else {
                                         $returnmsg = ERROR_MSG_CRITICAL1;
                                     }
                                 }
                             }
                             // CALL CONTENT AND REPLACE TAGS INSIDE
                             $content = $path_site . 'inc/cb/acctRegister.inc';
                             $returnOutput = new main_output($content);
                             // replace tags from template
                             @$returnOutput->replace_tags(array('path_site' => $path_site, 'return_msg' => $returnmsg, 'data_un' => $_REQUEST['user_name'], 'data_em' => $_REQUEST['user_email'], 'data_fn' => $_REQUEST['user_fname'], 'data_ln' => $_REQUEST['user_lname'], 'data_ag' => $data_ag, 'site_title' => SITE_TITLE, 'captcha' => recaptcha_get_html(CX_CAPTCHA_PUBLIC_KEY, $error, TRUE), 'disabled' => $disabled));
                             // Call the output
                             $contentOutput .= $returnOutput->output;
                         }
                         // CALL CONTENT AND REPLACE TAGS INSIDE
                         $content = $path_site . 'inc/cb/box_four.inc';
                         $returnOutput = new main_output($content);
                         // replace tags from template
                         @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'site_baseurl' => SITE_BASEURL_SECURE, 'return_msg' => $returnmsg, 'header_style' => 'banner', 'list' => replace_output(HH_PM_DHDR_REG_NAV1, array('path_site' => SITE_BASEURL_SECURE)), 'content' => $contentOutput));
                         // Call the output
                         $this->output .= $returnOutput->output;
                         // CALL CONTENT AND REPLACE TAGS INSIDE
                         $content = $path_site . 'inc/cb/acctRegister_tip.inc';
                         $returnOutput = new main_output($content);
                         // replace tags from template
                         @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE));
                         // Call the output
                         $this->output2 .= $returnOutput->output;
                     } else {
                         if ($section == 'pubProf') {
                             // PROF LEFT NAV ACTIVE START \\
                             $profnav['pubprof'] = 'active';
                             // PROF LEFT NAV ACTIVE END \\
                             if (!isset($_SESSION['user']['id'])) {
                                 redirect($path_site . 'profile/login.php');
                             }
                             // INIT OBJECTS \\
                             $returnmsg_pp = NULL;
                             if (isset($_REQUEST['submitupdate'])) {
                                 // check for errors
                                 if ($errors = $this->check('pubProf')) {
                                     $returnmsg_pp = replace_output(ERROR_PROFILE2, array('errors' => $errors));
                                 } else {
                                     // no errors
                                     if ($this->submit('pubProf')) {
                                         $returnmsg_pp = CONF_MSG_1;
                                         unset($_REQUEST);
                                     } else {
                                         $returnmsg_pp = ERROR_MSG_CONTACT2;
                                     }
                                 }
                             }
                             // Get Profile Information
                             $info = get_public_profile($_SESSION['user']['id']);
                             $image = get_public_profile_image($info['id']);
                             $c = get_colors();
                             $colors = NULL;
                             foreach ($c as $k => $v) {
                                 if ($k == '5') {
                                     $colors .= '</div><div class="left" style="width: 70px;">';
                                 }
                                 $sel = NULL;
                                 if ($info['colorid'] == $k) {
                                     $sel = ' checked="checked"';
                                 }
                                 $colors .= replace_output(HH_PM_PUBPROF_COLOR, array('check' => $sel, 'id' => $k, 'class' => $v));
                             }
                             // CALL CONTENT AND REPLACE TAGS INSIDE
                             $content = $path_site . 'inc/cb/acctPublic_profile.inc';
                             $returnOutput = new main_output($content);
                             // replace tags from template
                             @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'return_msg' => $returnmsg_pp, 'data_img' => SITE_BASEURL_SECURE . $image, 'data_blogurl' => stripslashes($info['urlBlog']), 'data_fburl' => stripslashes($info['urlFb']), 'data_liurl' => stripslashes($info['urlLi']), 'data_twtrurl' => stripslashes($info['urlTwtr']), 'data_yturl' => stripslashes($info['urlYt']), 'data_stmnt' => stripslashes($info['statement']), 'data_name' => stripslashes($info['name']), 'data_title' => stripslashes($info['title']), 'data_colors' => $colors));
                             // Call the output
                             $contentOutput .= $returnOutput->output;
                             // CALL CONTENT AND REPLACE TAGS INSIDE
                             $content = $path_site . 'inc/tpl/profile_body.inc';
                             $returnOutput = new main_output($content);
                             // replace tags from template
                             @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'site_baseurl' => SITE_BASEURL_SECURE, 'return_msg' => $returnmsg, 'profile_nav' => $cl->compile_profileNav($profnav), 'box_four' => get_profile_notif() . replace_output(file_get_contents($path_site . 'inc/cb/box_four.inc'), array('path_site' => SITE_BASEURL_SECURE, 'header_style' => 'nav', 'list' => replace_output(HH_PM_DHDR_PUBPROF_NAV, array('path_site' => SITE_BASEURL_SECURE)), 'content' => $contentOutput))));
                             // Call the output
                             $this->output .= $returnOutput->output;
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
<?php

show_view('header-w-wrap');
show_view('sidebar-profile-left');
?>

<div class="profile-content">

	<h1>dashboard</h1>
	
	<?php 
if ($user->is_business()) {
    echo get_profile_notif();
} else {
    ?>
		<div class="copy">
			<h3>Become a Vendor!</h3>
			<p>Advertise your products and services online, for only $20 a year!</p>
			<ul class="vendor-benefits">
				<li>create your web presence</li>
				<li>set up your online store in minutes</li>
				<li>merchant services are handled for you</li>
				<li>automated shipping for easy fulfillment</li>
				<li>put products in front of Portland Saturday Market shoppers</li>
			</ul>
			<a title="Link to register a company in the Portland Saturday Market services directory." alt="Link to register a company in the Portland Saturday Market services directory." href="<?php 
    echo Router::url(array('controller' => 'user', 'action' => 'register', 'vendor'));
    ?>
">
				<img src="http://shop.saturdaymarket.org.php5-19.dfw1-1.websitetestlink.com/img/btn_start_marketing_today.gif"/></a>
		</div>