Example #1
0
File: api.php Project: desawa12/NKR
function router()
{
    switch ($_GET["action"]) {
        case "contact":
            contact();
            break;
    }
}
Example #2
0
function format_line($line, $attachments)
{
    global $me;
    if ($line['is_from_me']) {
        $contact = $me;
    } else {
        $contact = $line['contact'];
    }
    $attachments_html = '';
    if (count($attachments)) {
        foreach ($attachments as $at) {
            $imgsrc = attachment_folder($line['contact'], $line['date'], true) . $at['transfer_name'];
            $attachments_html .= '<img src="' . $imgsrc . '" class="u-photo">';
        }
    }
    return '<div class="h-entry">' . '<time class="dt-published" datetime="' . date('c', $line['date']) . '">' . date('Y-m-d H:i:s', $line['date']) . '</time> ' . contact($contact) . ' <span class="e-content p-name">' . htmlentities(trim($line['text'])) . '</span>' . $attachments_html . '</div>';
}
Example #3
0
File: exec.php Project: nubix/cms
/**
* Wertet das Formular aus, und das Captcha
*/
function validateContactForm()
{
    global $msg;
    if ($_POST['cap'] != $_SESSION['captcha_data']) {
        $msg->error("Bitte tragen Sie unten die gesuchte Zahl zwischen 1 und 5 ein.");
    }
    if (empty($_POST['name'])) {
        $msg->note("Bitte tragen Sie Ihren Namen ein.");
    }
    if (empty($_POST['phone']) && empty($_POST['mail'])) {
        $msg->note("Wir würden Sie auch gerne Kontaktieren. Geben Sie daher Bitte Ihre Telefonnummer oder Ihre Emailadresse an.");
    }
    if (empty($_POST['message'])) {
        $msg->note("Bitte schreiben Sie uns eine Nachricht.");
    }
    unset($_SESSION['captcha_data']);
    if ($msg->note || $msg->error) {
        unset($_POST['submit']);
        return contact();
    }
    if (sendMail()) {
        $msg->success("Vielen Dank für Ihre Nachricht. Wir werden uns schnellst möglich darum kümmern.");
    } else {
        $msg->error("Leider gab es einen Fehler beim Abschicken des Formulars.");
        return showContactForm();
    }
}
Example #4
0
function contact_feedback_error()
{
    $contact = contact();
    return $contact->getText('contact.feedback-error');
}
Example #5
0
                    // Send subscription alert
                    $contact_message = "Contact request from: " . $name . "\n\n" . $message_to_send;
                    mail($your_email_address, "Contact Request", $contact_message);
                    if ($insertSignup) {
                        $status = "success";
                        $message = $messages[8];
                    } else {
                        $status = "error";
                        $message = $insertmsg_error;
                    }
                }
            }
        }
    }
    //return json response
    $data = array('status' => $status, 'message' => $message);
    echo json_encode($data);
    exit;
}
// Handle forms
if ($_GET['action'] == 'signup' && $use_mailchimp == true) {
    mailChimp($user_email, $api_key, $list_id, $error_messages);
} else {
    if ($_GET['action'] == 'signup' && $use_mysql == true) {
        mysqlSubscribe($mysql_settings, $mysql_table_subscriptions, $user_email, $error_messages);
    } else {
        if ($_GET['action'] == 'contact') {
            contact($mysql_settings, $mysql_table_contact, $full_name, $contact_email, $message, $error_messages);
        }
    }
}
Example #6
0
 case 'send_replyreview':
     $rev_id = JRequest::getInt('rev_id', 0);
     send_replyreview($rev_id, $option);
     break;
     /* Recommend to Friend */
 /* Recommend to Friend */
 case "recommend":
     recommend($link_id, $option);
     break;
 case "send_recommend":
     send_recommend($link_id, $option);
     break;
     /* Contact Owner */
 /* Contact Owner */
 case "contact":
     contact($link_id, $option);
     break;
 case "send_contact":
     send_contact($link_id, $option);
     break;
     /* Report Listing */
 /* Report Listing */
 case "report":
     report($link_id, $option);
     break;
 case "send_report":
     send_report($link_id, $option);
     break;
     /* Claim Listing */
 /* Claim Listing */
 case "claim":
Example #7
0
function about()
{
    echo "\n\t<div class='container'>\n\t\t<p>\n\t\t<div class='jumbotron' style='background-color: #FFFFFF!important;' style='border-color:#83DAF9!important;' style='border-style:solid!important;'>\n\t\t<p>\n\t\t\t<center><br><h2>Why choose Scott Mcleod</h2><br><br></center>\n\t\t\t<center><img class='smaller-image thin-gray-border'src='../Images/blog.jpg' width='200px' height='200px'><br><br></center>\n\t\t\tIt’s important to potential clients to understand how different and why they should choose Scott Mcleod. <br><br>I am incredibly passionate about cutting edge technology and providing a cost effective option to adapt the business needs and requirements as a company matures, strive to constantly improve and push boundaries,  take the time to fully understand your business and achieve significant success for you.  I don’t cut corners. keep you informed every step of the way\n\t\t\tMy experience with Web and Software Application development, 3d Modeling and animation extends back to 2006 were I Designed and Developed Smcleod Technologies Content Managment System, Created 3d Models and Web Applications to show case on the online store. <br><br>.\n\t\t\t <p></p>\n</div>\n\t<div class='panel panel-primary'>\n<div class='panel-heading'><center><h2>Education</h2></center></div>\n<div class='panel-body'>\n\t<div class='row'><!--Div1 Education-->\n      <div class='col-sm-8 col-lg-7'><!--Div2 Education-->\n        <hr>\n        <div class='row'><!--Div3 Education-->\n        \t<div class='col-xs-6'><h4>Certificate III Software Apps</h4><!--Div4 Education Start-->\n\t\t\t</div><!--Div4 Education End-->\n        \t<div class='col-xs-6'><!--Div5 Education-->\n        \t  <h4 class='text-right'>\n\t\t\t  <span class='glyphicon glyphicon-calendar' aria-hidden='true'>\n\t\t\t  </span> Jan 2003 - Sep 2003</h4>\n        \t</div><!--Div5 Education End-->\n        </div><!--Div3 Education End-->\n\t\t<div class='row'><!--Div2 Education new Row -->\t\n          <div class='col-xs-6'><h4>Diploma, Network Engineering</h4>\n          </div>\n          <div class='col-xs-6'>\n            <h4 class='text-right'><span class='glyphicon glyphicon-calendar' aria-hidden='true'></span> Jan 2004 - Dec 2005</h4>\n          </div>\n        </div>\n\t\t<div class='row'>\n          <div class='col-xs-6'>\n            <h4>Certificate IV Web Design</h4>\n          </div>\n          <div class='col-xs-6'>\n            <h4 class='text-right'><span class='glyphicon glyphicon-calendar' aria-hidden='true'></span> Jan 2006 - Dec 2006</h4>\n          </div>\n        </div>\n\t\t<div class='row'>\n          <div class='col-xs-6'>\n            <h4>Certificate IV Programming</h4>\n          </div>\n          <div class='col-xs-6'>\n            <h4 class='text-right'><span class='glyphicon glyphicon-calendar' aria-hidden='true'></span> Oct 2015 - Current</h4>\n          </div>\n        </div>\n\t\t</div>\n\t\t</div>\n  \t\t</div>\n\t\t</div>\n<!--              this is the skills section of the page   -->\n<div class='panel panel-success'>\n  <!-- Default panel contents -->\n  <!--              this is the skills section of the page   -->\n  <div class='panel-heading'><center><h2>Skills</h2></center></div>\n  <div class='panel-body'>\n\t<div class='row'> <!--Div1 Start Table rows <tr>-->\n\t\t<div class='col-sm-8 col-lg-7'><!--Div2 Table coloms <td>Start-->\n\t\t\t<div class='row'><!--Div3 Start new tr-->\n        \t<hr>\n\t\t\t\t<div class='col-xs-6'><!--Div4 Start-->\n\t\t\t\t\t<div class='progress'><!--Div5 Start-->\n          \t\t\t\t<div class='progress-bar progress-bar-danger\n\t\t\t\t\t\t\tprogress-bar-striped active' \n\t\t  \t\t\t\t\trole='progressbar' aria-valuenow='85' \n\t\t\t\t\t\t\taria-valuemin='0' \n\t\t\t\t\t\t\taria-valuemax='100' \n\t\t\t\t\t\t\tstyle='width: 85%'> <!--Div6 HTML Start-->\n\t\t\t\t\t\t\tCommunication\n\t\t\t\t\t\t</div><!--Div6 HTML End-->\n\t\t\t\t\t</div><!--Div5 End-->\n\t\t\t\t</div><!--Div4 End -->\n\t\t\t\t<div class='col-xs-6'><!--Div4 Start-->\n\t\t\t\t\t<div class='progress'><!--Div5 Start-->\n          \t\t\t\t<div class='progress-bar \n\t\t\t\t\t\t\tprogress-bar-info progress-bar-striped active' \n\t\t  \t\t\t\t\trole='progressbar' aria-valuenow='85' \n\t\t\t\t\t\t\taria-valuemin='0' \n\t\t\t\t\t\t\taria-valuemax='100' \n\t\t\t\t\t\t\tstyle='width: 85%'> <!--Div6 HTML Start-->\n\t\t\t\t\t\t\tProgramming\n\t\t\t\t\t\t</div><!--Div6 CSS End-->\n\t\t\t\t\t</div><!--Div5 End-->\n\t\t\t\t</div><!--Div4 End -->\n\t\t\t</div><!--Div3 End -->\n\t\t</div><!--Div2 End-->\n\t</div><!--Div1 End-->\n\t<div class='row'> <!--Div1 Start Table rows <tr>-->\n\t\t<div class='col-sm-8 col-lg-7'><!--Div2 Table coloms <td>Start-->\n\t\t\t<div class='row'><!--Div3 Start new tr-->\n        \t<hr>\n\t\t\t\t<div class='col-xs-6'><!--Div4 Start-->\n\t\t\t\t\t<div class='progress'><!--Div5 Start-->\n          \t\t\t\t<div class='progress-bar \n\t\t\t\t\t\t\tprogress-bar-success progress-bar-striped active' \n\t\t  \t\t\t\t\trole='progressbar' aria-valuenow='85' \n\t\t\t\t\t\t\taria-valuemin='0' \n\t\t\t\t\t\t\taria-valuemax='100' \n\t\t\t\t\t\t\tstyle='width: 85%'> <!--Div6 HTML Start-->\n\t\t\t\t\t\t\tLearning\n\t\t\t\t\t\t</div><!--Div6 HTML End-->\n\t\t\t\t\t</div><!--Div5 End-->\n\t\t\t\t</div><!--Div4 End -->\n\t\t\t\t<div class='col-xs-6'><!--Div4 Start-->\n\t\t\t\t\t<div class='progress'><!--Div5 Start-->\n          \t\t\t\t<div class='progress-bar \n\t\t\t\t\t\t\tprogress-bar-warning progress-bar-striped active' \n\t\t  \t\t\t\t\trole='progressbar' aria-valuenow='85' \n\t\t\t\t\t\t\taria-valuemin='0' \n\t\t\t\t\t\t\taria-valuemax='100' \n\t\t\t\t\t\t\tstyle='width: 45%'> <!--Div6 HTML Start-->\n\t\t\t\t\t\t\tVisual Design\n\t\t\t\t\t\t</div><!--Div6 HTML End-->\n\t\t\t\t\t</div><!--Div5 End-->\n\t\t\t\t</div><!--Div4 End -->\n\t\t\t</div><!--Div3 End -->\n\t\t</div><!--Div2 End-->\n\t</div><!--Div1 End-->\n  </div>\n</div>\n<div class='panel panel-default'>\n<div class='panel-heading'>\n\t<center><h3>< < - - SERVICES - - > ></h3>\n\t</center>\n\t</div>\n  <div class='panel-body'>\n\t<div class='row'> <!--Div1 Start Table rows <tr>-->\n\t\t<div class='col-sm-8 col-lg-7'><!--Div2 Table coloms <td>Start-->\n\t\t\t<div class='row'><!--Div3 Start new tr-->\n\t\t\t\t<div class='col-xs-6'>\n\t\t\t\t<ul>\n\t\t\t\t\n\t\t\t\t\t<li>Application Development</li>\n\t\t\t\t\t<li>Web Development</li>\n\t\t\t\t\t<li>Network Support</li>\n\t\t\t\t\t<li>Web Design</li>\n\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div><!--Div3 End -->\n\t\t</div><!--Div2 End-->\n\t</div><!--Div1 End-->\n\t </div>\n</div>\n\t<div>\n\t<div class='panel panel-info '>\n  \t<!-- Default panel contents -->\n  \t<div class='panel-heading'>\n\t<center><h3>WORK</h3>\n\t</center>\n\t</div>\n\t\n\t\t<div class='progress'><!--Div5 Start-->\n          \t<div class='progress-bar \n\t\t\tprogress-bar-danger progress-bar-striped active' \n\t\t  \trole='progressbar' aria-valuenow='85' \n\t\t\taria-valuemin='0' \n\t\t\taria-valuemax='100' \n\t\t\tstyle='width: 100%'> <!--Div6 HTML Start-->\n\t\t\tWeb Sites\n\t\t\t</div><!--Div6 HTML End-->\n\t\t</div><!--Div5 End-->\n\t\t";
    webTemplates();
    echo "<hr>\n\t<div class='progress'><!--Div5 Start-->\n          \t<div class='progress-bar \n\t\t\tprogress-bar-info progress-bar-striped active' \n\t\t  \trole='progressbar' aria-valuenow='85' \n\t\t\taria-valuemin='0' \n\t\t\taria-valuemax='100' \n\t\t\tstyle='width: 100%'> <!--Div6 HTML Start-->\n\t\t\tSoftware Applications\n\t\t\t</div><!--Div6 HTML End-->\n\t\t</div><!--Div5 End-->\n\t\t<hr>\n\t";
    softwareApps();
    echo "\n\t<!--<hr>-->\n\t<!--<div class='progress'>--><!--Div5 Start-->\n          \t<!--<div class='progress-bar \n\t\t\tprogress-bar-warning progress-bar-striped active' \n\t\t  \trole='progressbar' aria-valuenow='85' \n\t\t\taria-valuemin='0' \n\t\t\taria-valuemax='100' \n\t\t\tstyle='width: 100%'>--> <!--Div6 HTML Start-->\n\t\t\t<!--Training Material-->\n\t\t\t<!--</div>--><!--Div6 HTML End-->\n\t\t<!--</div>--><!--Div5 End-->\n\t\t<!--<hr>-->";
    //training();
    echo "<hr>\n\t<div class='progress'><!--Div5 Start-->\n          \t<div class='progress-bar \n\t\t\tprogress-bar-danger progress-bar-striped active' \n\t\t  \trole='progressbar' aria-valuenow='85' \n\t\t\taria-valuemin='0' \n\t\t\taria-valuemax='100' \n\t\t\tstyle='width: 100%'> <!--Div6 HTML Start-->\n\t\t\t3D Models\n\t\t\t</div><!--Div6 HTML End-->\n\t\t</div><!--Div5 End-->\n\t\t<hr>\n\t";
    threeDModels();
    //echo"3d Models";
    echo "<hr>\n\t<div class='progress'><!--Div5 Start-->\n          \t<div class='progress-bar \n\t\t\tprogress-bar-success progress-bar-striped active' \n\t\t  \trole='progressbar' aria-valuenow='85' \n\t\t\taria-valuemin='0' \n\t\t\taria-valuemax='100' \n\t\t\tstyle='width: 100%'> <!--Div6 HTML Start-->\n\t\t\tWeb Based Games\n\t\t\t</div><!--Div6 HTML End-->\n\t\t</div><!--Div5 End-->\n\t\t<hr>\n\t";
    gameDevelopment();
    echo "</div>\n\t";
    contact();
}
Example #8
0
?>
</head>

<body <?php 
body_class();
?>
>

<?php 
if ($_POST['contact_submit']) {
    $contact_name = $_POST['contact_name'];
    $contact_email = $_POST['contact_email'];
    $contact_phone = $_POST['contact_phone'];
    $contact_message = $_POST['contact_message'];
    $contact_verify = rand();
    contact($contact_verify, $contact_name, $contact_email, $contact_phone, $contact_message);
}
?>

<?php 
if ($_POST['dealer_submit']) {
    $dealer_dealership = $_POST['dealer_dealership'];
    $dealer_rep = $_POST['dealer_rep'];
    $dealer_website = $_POST['dealer_website'];
    $dealer_email = $_POST['dealer_email'];
    $dealer_phone = $_POST['dealer_phone'];
    $dealer_years = $_POST['dealer_years'];
    $dealer_showroom = $_POST['dealer_showroom'];
    $dealer_message = $_POST['dealer_message'];
    dealer($dealer_dealership, $dealer_rep, $dealer_website, $dealer_email, $dealer_phone, $dealer_years, $dealer_showroom, $dealer_message);
}
Example #9
0
/**
 * Template Name: Contact
 * Description: A full-width template with no sidebar
 *
 * @package WordPress
 * @subpackage lgdcom
 * @since lgdcom 0.1
 */
get_header();
?>
		
			
				<div class="slideshowWrap">	
					  <?php 
contact();
?>
					  <?php 
map();
?>
 
				</div>
				
				<div id="main" role="main">
				
				<?php 
booking();
?>
								
				<div class="container halfGrid">
					<?php 
Example #10
0
File: mod.php Project: philum/cms
function build_mods($r)
{
    //p($r);
    $ptit_css = 'txtcadr';
    $pbdy_css = 'panel';
    $smcss = 'small';
    //mod,param,title,condition,command,option,(bloc),hide,template,nobr,div,ajxbtn
    list($m, $p, $t, $c, $d, $o, $ch, $hd, $tp, $nbr, $dv, $jbt) = $r;
    $t = stripslashes($t);
    switch ($m) {
        //main
        case 'LOAD':
            if ($_SESSION['read']) {
                $ret = art_read($tp);
            } else {
                $ret = api_arts($_SESSION['frm'], $o, $tp);
            }
            break;
        case 'Page_titles':
            $ret = page_titles($o);
            break;
        case 'All':
            $api = api_arts_rq($p, $o);
            $api['t'] = $t ? $t : nms(100);
            break;
        case 'category':
            if ($p == 1 && $_SESSION['frm'] == 'Home') {
                $p = 'All';
            }
            $ret = api_arts($p, $o, $tp);
            break;
        case 'Board':
            $ret = collect_board($p);
            break;
        case 'plan':
            $ret = arts_plan($m, $p);
            break;
        case 'Hubs':
            $ret = arts_plan($m, $p);
            break;
        case 'gallery':
            $ret = arts_plan($m, $p);
            break;
        case 'tracks':
            $ret = trkarts($p, $t);
            break;
            //api_tracks($t)
        //api_tracks($t)
        case 'MenusJ':
            $ret = ajxlink($p, 'mjx', $o, $d);
            break;
            //case('Wall'): $ret=wall_arts($t,$p); break;
        //case('Wall'): $ret=wall_arts($t,$p); break;
        case 'api':
            $ret = plugin('apicom', str_replace(';', ',', $p), $o);
            break;
        case 'api_mod':
            $api = api_defaults_rq(explode_k(str_replace(';', ',', $p), ',', ':'));
            break;
            //:,
        //:,
        case 'api_arts':
            $api = api_mod_arts($p, $t, $tp);
            if ($d == 'panel') {
                $api['cmd'] = $d;
            }
            $api['cols'] = $o;
            break;
            //&=
        //&=
        case 'articles':
            $load = api_mod_arts_row($p);
            $obj = 1;
            break;
            //&=
            //case('articles'): $api=api_mod_rq($p.'&t=x'); break;//&=
        //&=
        //case('articles'): $api=api_mod_rq($p.'&t=x'); break;//&=
        case 'tab_mods':
            $ret = tab_mods($p);
            break;
        case 'last':
            $ret = art_read_b('last', $n, 3, '');
            break;
        case 'player':
            $ret = flash_prep('', $p);
            break;
        case 'friend_art':
            $ret = friend_art($o);
            break;
        case 'friend_rub':
            $ret = friend_rub($o);
            break;
        case 'related_arts':
            $load = related_art();
            break;
        case 'related_by':
            $load = related_art_by();
            break;
        case 'prev_next':
            $ret = prevnext_art($d, $p, $o);
            break;
        case 'cat_arts':
            $p = $p != 1 ? $p : $_SESSION['frm'];
            $t = $t != $m ? $t : $p;
            $load = tri_rqt($p, 1, $_SESSION['dayx']);
            break;
        case 'priority_arts':
            $load = tri_rqt($p, 11);
            $t = $t != $m ? $t : $p;
            break;
        case 'recents':
            $load = recents_arts($p, $o);
            $obj = 1;
            break;
        case 'read':
            $ret = divc($o, read_msg($p, 3));
            break;
        case 'popart':
            $ret = pop_art($p);
            break;
        case 'pub_art':
            $ret = pub_art_b($p, $o);
            break;
        case 'pub_arts':
            $load = array_flip(explode(' ', $p));
            break;
        case 'pub_img':
            $ret = pub_img($p);
            break;
        case 'taxo_arts':
            $load = taxo_arts($p);
            if ($t > 1) {
                $t = suj_of_id($t);
            }
            break;
        case 'taxo_nav':
            $ret = plugin('taxonav', $p, $o);
            break;
        case 'read_art':
            $ret = read_art($p, $t);
            $t = '';
            break;
        case 'short_arts':
            $load = short_arts($p);
            if ($o <= 3) {
                $prw = $o;
            }
            break;
        case 'most_read':
            $ret = most_read_mod($p, $t, $d, $o, $m, $tp);
            $t = '';
            break;
        case 'same_title':
            $load = same_title();
            break;
        case 'deja_vu':
            if ($_SESSION['mem']) {
                $load = $_SESSION['mem'];
            }
            break;
            //com
        //com
        case 'rss_input':
            if ($p) {
                $ret = rssin(ajx($p, 1));
            }
            break;
        case 'disk':
            require_once 'ajxf.php';
            $_SESSION['dlmod'] = $p;
            if ($p && $p != '/') {
                $pb = '/' . $p;
            }
            $ret = divd('dsnavds', ds_nav('dl', 'users/' . ses('qb') . $pb));
            break;
        case 'finder':
            $ra = array('|', '-');
            $p = str_replace($ra, '/', $p);
            $o = str_replace($ra, '/', $o);
            req('finder');
            $ret = finder($p, $o, $d);
            break;
        case 'channel':
            $ret = plugin('channel', $p, $t, $d, $o);
            $t = '';
            break;
        case 'hour':
            setlocale(LC_TIME, "fr_FR");
            //%A%d%B%G%T
            if ($p) {
                $dat = strftime($p ? $p : '%y%m%d:%H%M', $_SESSION['dayx']);
            } else {
                $dat = mkday('', 1);
            }
            if (!$d) {
                $ret = btn($o, $dat);
            } else {
                $ret = divc($o, $dat);
            }
            break;
        case 'cart':
            $ret = lkc("txtcadr", "/?plug=cart", $p != 1 ? $p : "Cart");
            $ret = divd('cart', m_pubart($_SESSION['cart'], 'scroll', 7));
            break;
        case 'video':
            $ret = video_auto($p, '', '', 3);
            break;
        case 'video_playlist':
            $load = videoplaylist($p);
            $obj = 1;
            $prw = 'vd';
            break;
        case 'video_viewer':
            $ret = videoboard($p, $c, $o);
            break;
            //txt
        //txt
        case 'text':
            $ret = stripslashes(urldecode($p));
            if ($o) {
                $ret = divc($o, $ret);
            }
            break;
        case 'connector':
            if (substr($p, 0, 1) != "[" && substr($p, -1, 1) != "]") {
                $p = '[' . $p . ']';
            }
            $ret = nl2br(format_txt_r($p, '', ''));
            if ($o == 'article') {
                $ret = balc('article', 'justy', format_txt($p, '', ''));
            }
            break;
        case 'codeline':
            if ($p) {
                $ret = correct_txt($p, "", 'codeline');
            }
            break;
        case 'clear':
            $ret = divc("clear", "");
            break;
        case 'hr':
            $ret = '<hr' . atc($p) . ' />';
            break;
        case 'br':
            $ret = br();
            break;
            //menus
            //case('ajax'): $ret=lj('',$p,$t); break;
        //menus
        //case('ajax'): $ret=lj('',$p,$t); break;
        case 'conn':
            $ret = connectors($p, $o, '');
            break;
        case 'link':
            if ($d == 'noli') {
                $ret = special_link($p, $o);
            } else {
                if (strpos($p, '§')) {
                    list($p, $t) = split_one('§', $p, 0);
                }
                $lin[] = mod_link_r($p, $t);
            }
            break;
        case 'user_menu':
            $ret = user_menu($p);
            break;
            //mod_link
        //mod_link
        case 'app_link':
            $ret = read_apps_link($p, $d, $o);
            break;
        case 'app_menu':
            $r = build_apps($p, $d);
            $ra = m_apps($r, 'menu', '');
            if ($o == 'icons') {
                $ret = desktop_build_ico($ra, 'icones');
            } else {
                $ret = app_list($ra, '', $o);
            }
            $ret .= divc('clear', '');
            break;
        case 'app_popup':
            Head::add('jscode', sj(read_apps(explode(',', $p))));
            break;
        case 'categories':
            $line = $_SESSION['line'];
            if ($line) {
                ksort($line);
                $d = $d ? $d : 'lines';
                if ($d == 'cols' && !$o) {
                    $o = 4;
                }
                if ($o == 'home') {
                    $lin[] = array($_GET['module'], 'module', 'Home', 'Home');
                }
                foreach ($line as $k => $va) {
                    if ($o == 'nb') {
                        $ka = $k . ' (' . $va . ')';
                    } else {
                        $ka = $k;
                    }
                    $lin[] = array($_SESSION['frm'], 'cat', $k, $ka);
                }
            }
            break;
        case 'overcats':
            req('bubs');
            return mkbub(bub_root('overcat', 'zero'), 'inline', '1');
            break;
        case 'MenuBub':
            req('bubs');
            return mkbub(bub_root('menubub', 'zero'), 'inline', '1');
            break;
        case 'timetravel':
            return timetravel($p, $o);
            break;
        case 'submenus':
            return bubble_menus($p, $o);
            break;
        case 'taxonomy':
            $ret = taxonomy($p, $o);
            break;
        case 'rub_taxo':
            $ret = rub_taxo($p, $t);
            $t = '';
            break;
        case 'folders':
            $load = supertriad_ask();
            $prw = $o;
            $obj = 63;
            break;
        case 'desk':
            $ret = deskmod($p);
            break;
        case 'desktop_arts':
            $ret = title($t) . desktop_arts($p, $o, 'arts');
            break;
        case 'desktop_varts':
            $ret = title($t) . desktop_arts($p, $o, 'varts');
            break;
        case 'desktop_files':
            $ret = title($t) . desktop_arts($p, $o, 'files');
            break;
        case 'hierarchics':
            $in = m_suj_hierarchic('active', '');
            $ret = balc("ul", $pbdy_css, $in);
            break;
            //cacheable
        //cacheable
        case 'hubs':
            $mn = $_SESSION['mn'];
            if (count($mn) >= 2) {
                $t = $p != 1 ? $p : $t;
                if ($t) {
                    $t = lkc('', htac('module') . 'hubs', $t);
                }
                $in = m_nodes_b($mn, $o);
                $ret = balc("ul", $pbdy_css, $in);
            }
            break;
        case 'tags':
            if ($t) {
                $t = lkc('', '/plugin/tags/' . $p . '/1', $t);
            }
            $lin = tag_mod($p, $o, $d);
            break;
        case 'tags_cloud':
            $p = $p ? $p : 'tag';
            $ret = btn($ptit_css, lkc('', "/plug/tags", $p));
            $line = tags_list($p, ses('nbj'));
            $in = tags_cloud($line, 10, 22, ' ', $p);
            $ret .= divc($pbdy_css, $in);
            break;
        case 'tag_arts':
            list($p, $o) = split_one(':', $p);
            $load = tag_arts($p, $o);
            break;
        case 'last_tags':
            $lin = last_tags($p, $o, $d);
            break;
        case 'classtag_arts':
            $load = classtag_arts($p);
            break;
            //class find id//$o=$p;
        //class find id//$o=$p;
        case 'see_also-tags':
            $r = see_also_tags($p ? $p : 'tag');
            if ($r) {
                $ret = see_also($r, $p, $d, $o, $tp);
            }
            break;
        case 'see_also-rub':
            $t = $p != 1 ? $p : $_SESSION['frm'];
            if ($_GET['read']) {
                $load = see_also_rub($p);
            }
            break;
        case 'see_also-source':
            list($load, $t) = see_also_source($o);
            break;
        case 'siteclics':
            $ret = siteclics($p);
            break;
        case 'rub_tags':
            $ret = rub_tags($p);
            break;
        case 'sources':
            if ($t) {
                $t = lkc('', '/module/source', $t);
            }
            $lin = art_sources($p);
            break;
        case 'msql_links':
            if ($o == 'rss') {
                $l = '/?plug=rssin&rssurl=';
            } elseif ($o == 'mail') {
                $l = 'mailto:';
            } else {
                $l = '';
            }
            $ret = msql_links($p, $o, $l, $d, $t);
            $t = '';
            break;
        case 'rss':
            $ret .= balc('ul', 'panel', divd('rssj', rssj($p ? $p : 'rssurl', $o)));
            break;
        case 'rssin':
            $ret .= rssj_m($p, $o);
            break;
        case 'chat':
            if ($t) {
                $t = ljb('', 'SaveD', 'cht' . $p . '_chat_' . $p, $t);
            }
            $p = $p != 1 ? $p : 'pub';
            $in = plugin('chat', $p, $o ? $o : 10);
            if ($in) {
                $ret = divc($pbdy_css, $in);
            }
            break;
        case 'stats':
            $ret = plugin('stats', '', '');
            break;
        case 'archives':
            if ($p == 1) {
                $p = $m;
            }
            if ($p) {
                $ret = btn($ptit_css, $p);
            }
            $in = divd("archives", m_archives(""));
            $ret .= balc('ul', $pbdy_css, $in);
            break;
        case 'agenda':
            $load = sql('ib,msg', 'qdd', 'kv', 'val="agenda"');
            $tim = time();
            if ($load) {
                foreach ($load as $k => $v) {
                    if (strtotime($v) < $tim) {
                        unset($load[$k]);
                    }
                }
            }
            break;
        case 'folders_varts':
            $load = mod_varts($p);
            break;
        case 'panel_arts':
            $ret = plugin_func('panart', 'panart_build', $p);
            break;
        case 'calendar':
            $in = calendar(ses('daya'));
            if ($p == 1) {
                $p = $m;
            }
            if ($p) {
                $ret = btn($ptit_css, $p);
            }
            $ret .= divc($pbdy_css, $in);
            break;
        case 'newsletter':
            if ($o) {
                $ret = call_plug($ptit_css, 'popup', 'mailist', $p, $p) . ' ';
            } else {
                $ret = plugin('mailist', '', $p);
            }
            break;
        case 'bridge':
            $_GET['urlsrc'] = $p = 'http://' . $p . '/' . ajx($t, 1);
            $rea = vacuum($p, '');
            $po['suj'] = $rea[0];
            $po['msg'] = format_txt($rea[1], 3, $id);
            $po['source'] = picto('link') . ' ' . pub_link($p);
            $ret = template($po, '');
            break;
        case 'columns':
            $ret = mod_columns($p, $o);
            break;
            //users
        //users
        case 'login':
            $ret = login_btn($p, $o);
            break;
        case 'login_popup':
            $ret = login_btn_p($p, $o);
            break;
        case 'log-out':
            if (ses('USE')) {
                $ret .= lkc($smcss, '/logout', picto('logout')) . ' ';
            }
            break;
        case 'search_form':
            $ret = search_btn($p, $o, '', $d);
            break;
        case 'search':
            $load = plugin_func('search', 'rech', $p, $o);
            break;
        case 'social':
            $ret = plugin('social', $p, $o);
            break;
            //banner
        //banner
        case 'Banner':
            $ret = make_ban($p, $t, $o);
            break;
        case 'ban_art':
            if ($p != 1) {
                $ret .= lka(subdom(ses('qb')), read_msg($p, ''));
            }
            break;
            //footer
        //footer
        case 'credits':
            $ret = lj('bevel', 'popup_about', picto('phi2'));
            break;
        case 'admin':
            $ret = lkc($smcss, '/admin/log/open', $t ? $t : picto('admin')) . ' ';
            $t = '';
            break;
        case 'chrono':
            $ret = btn('txtsmall2', round(mtime() - $_SESSION['stime'], 2) . 's') . ' ';
            break;
        case 'contact':
            $ret = contact($p, $o ? $o : $smcss) . ' ';
            break;
            //plugs
        //plugs
        case 'taxonav':
            return plugin('taxonav', $p, $t);
            $t = '';
            break;
        case 'iframe':
            $ret = plugin('ifram', '', '');
            break;
        case 'suggest':
            $ret = pluginside(nms(126), 'suggest', $p, $o);
            break;
        case 'create_art':
            $ret = f_inp('', '');
            break;
        case 'twitter':
            if ($p) {
                $ret = plugin('twitter', $p, $o);
            }
            break;
        case 'profil':
            $ret = plugin_func('profil', $p, $o);
            break;
            //special
        //special
        case 'BLOCK':
            $ret = build_modules($p, '');
            break;
        case 'module':
            $ret = build_mod_r($p);
            break;
        case 'command':
            $ret = com_mod($p);
            break;
        case 'plug':
            list($pp, $po) = split('-', $o);
            $ret = plugin($p, $pp, $po);
            break;
        case 'pluf':
            list($pp, $po) = split('-', $p);
            list($op, $oo) = split('-', $o);
            $ret = plugin_func($pp, $po, $op, $oo);
            break;
        case 'plup':
            return lj('', 'popup_plupin___' . $p . '_' . $o . '_', $t ? $t : $p);
            break;
        case 'close':
            $ret = '';
        default:
            if ($p && $m) {
                $reb = connectors($p . ($o ? '§' . $o : '') . ':' . $m, "", "");
            }
            if ($reb && $reb != '[' . $p . ':' . $m . ']') {
                $ret = $reb;
            } else {
                $reb = plugin($m, $p, $o);
                if ($reb) {
                    $ret = build_titl('', $t ? $t : $m, '') . $reb;
                }
            }
            break;
    }
    //menus
    if ($lin) {
        $ret = mod_lin($lin, $t, $d, $o);
    }
    //arts
    if ($load) {
        $ret = mod_load($load, $ret, $t, $d, $o, $obj, $prw, $tp, $id);
    }
    //api
    if ($api) {
        $ret = api_load($api);
    }
    //umods
    if (!$ret && !$lin && !$load && $p && $m) {
        //user_mods
        $func = msql_read('', $_SESSION['qb'] . '_modules', $m);
        if ($func && !is_array($func)) {
            $ret = cbasic($func, $p);
        }
    }
    if (!$nbr) {
        $br = br();
    }
    if ($ret) {
        if ($dv) {
            return divc('mod', $ret) . $br;
        } else {
            return $ret . $br;
        }
    }
}
Example #11
0
function center()
{
    // fatal session produced on failed login, and will display error message.
    if (isset($_SESSION[_SITE . 'fatal'])) {
        echo $_SESSION[_SITE . 'fatal'];
        unset($_SESSION[_SITE . 'fatal']);
    } else {
        global $categorySEF, $subcatSEF, $articleSEF;
        switch (true) {
            case isset($_GET['category']):
                $action = $categorySEF;
                break;
            case isset($_GET['action']):
                $action = $categorySEF == '404' ? $categorySEF : clean(cleanXSS($_GET['action']));
                break;
        }
        switch (true) {
            case isset($_POST['search_query']):
                search();
                return;
                break;
            case isset($_POST['comment']):
                comment('comment_posted');
                return;
                break;
            case isset($_POST['contactform']):
                contact();
                return;
                break;
            case isset($_POST['Loginform']):
                administration();
                return;
                break;
            case isset($_POST['submit_text']):
                processing();
                return;
                break;
        }
        if (_ADMIN) {
            switch ($action) {
                case 'administration':
                    administration();
                    return;
                    break;
                case 'snews_settings':
                    settings();
                    return;
                    break;
                case 'snews_categories':
                    admin_categories();
                    return;
                    break;
                case 'admin_category':
                    form_categories();
                    return;
                    break;
                case 'admin_subcategory':
                    form_categories('sub');
                    return;
                    break;
                case 'groupings':
                    admin_groupings();
                    return;
                    break;
                case 'admin_groupings':
                    form_groupings();
                    return;
                    break;
                case 'snews_articles':
                    admin_articles('article_view');
                    return;
                    break;
                case 'extra_contents':
                    admin_articles('extra_view');
                    return;
                    break;
                case 'snews_pages':
                    admin_articles('page_view');
                    return;
                    break;
                case 'admin_article':
                    form_articles('');
                    return;
                    break;
                case 'article_new':
                    form_articles('article_new');
                    return;
                    break;
                case 'extra_new':
                    form_articles('extra_new');
                    return;
                    break;
                case 'page_new':
                    form_articles('page_new');
                    return;
                    break;
                case 'editcomment':
                    edit_comment();
                    return;
                    break;
                case 'snews_files':
                    files();
                    return;
                    break;
                case 'process':
                    processing();
                    return;
                    break;
                case 'logout':
                    session_destroy();
                    echo '<meta http-equiv="refresh" content="2; url=' . _SITE . '">';
                    echo '<h2>' . l('log_out') . '</h2>';
                    return;
                    break;
            }
        }
        switch ($action) {
            case 'archive':
                archive();
                break;
            case 'sitemap':
                sitemap();
                break;
            case 'contact':
                contact();
                break;
            case 'login':
                login();
                break;
            case '404':
                echo l('error_404');
                break;
            default:
                articles();
                break;
        }
    }
}
Example #12
0
File: admin.php Project: philum/cms
function admin()
{
    $qb = ses('qb');
    $qda = ses('qda');
    $qdu = ses('qdu');
    $USE = ses('USE');
    $auth = ses('auth');
    $admin = $_GET['admin'] ? $_SESSION['admin'] = $_GET['admin'] : $_SESSION['admin'];
    if ($_GET['set']) {
        $_SESSION['set'] = $_GET['set'];
    }
    if ($USE != "") {
        $hubname = rse("hub", $qdu . ' WHERE name="' . $qb . '"');
        if (!$hubname) {
            $hubname = $qb;
        }
        list($autologok, $userhub) = sql('name,hub', 'qdu', 'r', 'ip="' . hostname() . '"');
    }
    $rep = "params";
    //verif_user
    if ($USE != $qb && $USE != "" && $userhub) {
        $hub = lka('/' . $USE, $USE);
    } elseif ($USE != $qb && $USE != "" && $autologok != $USE && $autologok) {
        $alert .= lkc('txtx', '/?log=on', 'autolog') . ' ';
    } elseif ($USE == $qb && !$userhub && prmb(11) >= 4) {
        $alert .= lkc("txtred", "/?log=create_hub", "create_hub!");
    } elseif ($USE == "") {
        $reta = lkc('txtx', htac('module') . 'Home', $qb) . br() . br() . loged($USE, $_SESSION['iq'], "", 7) . br();
    }
    //admin_menu
    $aff = adminauthes();
    if ($admin == "=") {
        $_SESSION['set'] = $_GET['set'] = $USE ? "Global" : "User";
    }
    //defaults
    if ($aff[$_GET['set']]) {
        $admin = key($aff[$_GET['set']]);
    }
    $_SESSION['admin'] = $admin;
    $goto = '/?admin=' . $admin;
    //if(!$userhub){unset($aff['User']['mail']); unset($aff['User']['password']);}
    //auto_select_category
    foreach ($aff as $k => $v) {
        if ($v[$admin]) {
            $_SESSION['set'] = $k;
            $curauth = $v[$admin];
        }
        $raf = array_merge_b($raf, array_keys($v));
    }
    if ($curauth === false) {
        $curauth = 7;
    }
    //login
    if ($USE) {
        $w .= lkc('popw', htac('module') . 'Home', pictxt('home', $hubname)) . ' ';
        $w .= btn("popbt", pictxt('user', $USE . ' ' . asciinb($auth)) . ' (' . nameofauthes($auth) . ')');
    }
    //fastmenu
    $fmn = array('console', 'params', 'restrictions', 'apps', 'css', 'finder', 'templates', 'connectors', 'plugin', 'msql', 'tools', 'pictos', 'stats', 'update');
    foreach ($raf as $v) {
        if (in_array($v, $fmn)) {
            $tit .= lkc(active($admin, $v), htac('admin') . $v, pictit(mimes_types($v), $v)) . ' ';
        }
    }
    $reta .= divc('right', $w . $alert);
    $tit .= lkc('txtit', htac('admin') . $admin, $admin) . ' ';
    if ($admin != "=") {
        $reta .= div('', $tit);
    }
    if ($auth >= 7 && $admin == 'update') {
        $ret = adm_update();
    }
    if ($auth >= $curauth && $curauth) {
        switch ($admin) {
            //global
            case 'console':
                $ret = adm_console($auth);
                break;
            case 'apps':
                require_once 'adminx.php';
                $ret = adm_apps($_GET['set'], '', $_GET['dig']);
                break;
            case 'messages':
                if ($qb == $USE or $auth >= $curauth) {
                    $ret = adm_messages();
                } else {
                    $ret = contact(nms(84), 'txtcadr');
                }
                break;
            case 'hubs':
                $ret = adm_hubs($auth);
                break;
            case 'nodes':
                $ret = adm_nodes($auth, $goto);
                break;
            case 'stats':
                list($p, $o) = explode('/', $_GET['set']);
                $ret = plugin('stats', $p, $o);
                break;
            case 'newsletter':
                $ret = adm_newsletter($_GET['send']);
                break;
            case 'disk':
                $ret = plugin('disk', '', '');
                break;
            case 'share':
                $ret = plugin('share', '', '');
                break;
            case 'tickets':
                $ret = plugin('tickets', '', '');
                break;
            case 'faq':
                $r = msql_read('system', 'program_faq', '');
                $ret = nl2br(stripslashes(make_divtable($r, 1)));
                break;
        }
        //articles
        if ($_SESSION['set'] == 'Articles') {
            switch ($admin) {
                case 'create':
                    $ret = f_inp('', '');
                    break;
                case 'categories':
                    $ret = catarts();
                    break;
                case 'trackbacks':
                    req('mod,art');
                    $ret = trkarts('');
                    break;
                default:
                    $ret = adminarts();
                    break;
            }
        }
        switch ($admin) {
            case 'chat':
                require_once 'art.php';
                $ret = output_trk(read_idy('microchat', 'DESC'));
                break;
            case 'shop':
                $ret = helps('shop_class');
                break;
            case 'book':
                $ret = lkc('txtblc', '/plug/book.php', 'book');
                break;
        }
        //configs
        switch ($admin) {
            case 'restrictions':
                $ret = adm_restrictions();
                break;
            case 'params':
                $ret = adm_params($curauth, rep);
                break;
            case 'avatar':
                if ($USE) {
                    $ret = adm_avatar(0);
                }
                break;
            case 'mail':
                if ($_POST['amail']) {
                    if ($USE == $qb) {
                        $_SESSION['qbin']['adminmail'] = $_POST['amail'];
                    }
                    update('qdu', 'mail', $_POST['amail'], 'name', $USE);
                }
                $ml = rse('mail', $qdu . ' WHERE name = "' . $USE . '"');
                if ($ml) {
                    $valu = input2('text', 'amail', $ml . '" size="35" maxlength="50') . ' ' . input2('submit', 'Submit', 'modif_mail', '');
                }
                $ret = form($goto, $valu);
                break;
            case 'password':
                $ret = set_password($USE);
                break;
            case 'banner':
                $ret = set_ban();
                break;
            case 'descript':
                $ret = editbrain($admin);
                break;
            case 'google':
                $ret = editbrain($admin);
                break;
            case 'members':
                $ret = adm_members_a($auth, $goto);
                break;
            case 'authes':
                $titles = array('fonction', 'auth');
                if (auth(6)) {
                    $ret = msqlink('system', 'admin_authes') . br();
                }
                foreach ($aff as $k => $v) {
                    $datas = '';
                    arsort($v);
                    foreach ($v as $ka => $va) {
                        $datas[$ka] = array($va);
                    }
                    $outre[$k] = make_tables($titles, $datas, 'txtblc', '');
                }
                $ret .= make_tabs($outre, 'at');
                break;
        }
        //constructors
        switch ($admin) {
            case 'css':
                $ret = adm_editcss();
                break;
            case 'fonts':
                $ret = edit_fonts();
                break;
            case 'connectors':
                $ret = data_brain('connectors') . br() . br();
                $ret .= lkc('txtblc', $goto . '&help==', 'connectors_infos') . br();
                if ($_GET['help']) {
                    $ret .= conn_help() . br();
                }
                break;
            case 'modules':
                $ret = data_brain('modules') . br() . br() . adm_mod_hlp($goto);
                break;
            case 'templates':
                $ret = data_brain('template');
                break;
            case 'plugin':
                $ret = adm_plugin();
                break;
            case 'msql':
                $ret = adm_msql();
                break;
            case 'dev':
                $ret = plugin('dev', '', '');
                break;
            case 'editags':
                req('meta');
                $ret = admin_tags(get('set'));
                break;
            case 'finder':
                $ret = call_finder($qb, 'disk');
                break;
            case 'backup':
                $ret = adm_backup($qb, $auth, $goto, $rep);
                break;
            case 'update_notes':
                $ret .= adm_update_notes('', 1);
                break;
            case 'plug':
                $ret .= adm_edit_plug();
                break;
        }
        if ($admin && !$ret && $auth >= $curauth) {
            //editbrain
            $ret = plugin($admin, $_GET['p'], $_GET['o']);
        }
    } else {
        switch ($admin) {
            case 'members':
                $ret = adm_members_b();
                break;
        }
    }
    #render
    if ($_SESSION['admin'] && !$_GET['callj']) {
        $head = $reta . br();
    } else {
        $head = bal('h2', lka('/admin/' . $_SESSION['admin'], $_SESSION['admin'])) . br();
    }
    return $head . $ret;
}
Example #13
0
<?php

function contact()
{
    if (count($_POST) > 0) {
        //var_dump($_POST); // Display $_POST vars
        if (isset($_POST["email"])) {
            //Store post var
            $name = trim(strip_tags($_POST["name"]));
            $company = trim(strip_tags($_POST["company"]));
            $comment = trim(strip_tags($_POST["comment"]));
            $email = trim(strip_tags($_POST["email"]));
            //Sending confirmation by mail
            $to = "*****@*****.**";
            $subject = "Offre d'emploi";
            $msg = "<h1>" . $company . "(" . $name . ")" . "(" . $email . ")" . "</h1>\n\t\t\t\t\t<p>" . $comment . "</p>";
            $headers = 'MIME-Version: 1.0' . "\r\n";
            $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
            $headers .= 'From: jobs@gregorymeis.me' . "\r\n";
            mail($to, $subject, $msg, $headers);
            //HideForm and create status
            return "ok";
        } else {
            return "failed";
        }
    }
}
echo contact();
Example #14
0
function center($article_limit)
{
    if (isset($_GET['category'])) {
        $id = $_GET['category'];
    }
    if (isset($_GET['articleid'])) {
        $articleid = $_GET['articleid'];
    }
    if (isset($_POST['submit_text'])) {
        processing();
        $processed = True;
    }
    if (isset($_POST['contactform'])) {
        contact();
        $processed = True;
    }
    if (isset($_GET['category'])) {
        $action = $_GET['category'];
    } else {
        if (isset($_GET['action'])) {
            $action = $_GET['action'];
        }
    }
    if (isset($processed) and $processed == True) {
        unset($action);
    }
    switch ($action) {
        case "archives":
            archives();
            break;
        case "contact":
            contact();
            break;
        case "rss":
            rss();
            break;
        case "login":
            login();
            break;
        case "categories":
            if (isset($_SESSION['Logged_In'])) {
                view_categories();
            }
            break;
        case "editcategory":
            if (isset($_SESSION['Logged_In'])) {
                edit_category();
            }
            break;
        case "new":
            if (isset($_SESSION['Logged_In'])) {
                new_article();
            }
            break;
        case "unpublished":
            if (isset($_SESSION['Logged_In'])) {
                unpublished_articles();
            }
            break;
        case "simpleedit":
            if (isset($_SESSION['Logged_In'])) {
                edit_article(simple);
            }
            break;
        case "advancededit":
            if (isset($_SESSION['Logged_In'])) {
                edit_article(advanced);
            }
            break;
        case "editcomment":
            if (isset($_SESSION['Logged_In'])) {
                edit_comment();
            }
            break;
        case "images":
            if (isset($_SESSION['Logged_In'])) {
                images();
            }
            break;
        case "process":
            if (isset($_SESSION['Logged_In']) and $display_further != "NO") {
                processing();
            }
            break;
        case "logout":
            session_start();
            $_SESSION = array();
            session_destroy();
            echo "<META HTTP-EQUIV='refresh' content='1; URL=" . $_SERVER['PHP_SELF'] . "'>";
            echo "<h2>" . l('log_out') . "</h2>";
            break;
        default:
            if (isset($_POST['search'])) {
                search();
            } else {
                if (isset($_POST['comment'])) {
                    comment("comment_posted");
                } else {
                    if ($processed == False) {
                        $article = get_id('article');
                        $category = get_id('category');
                        if ($article != "") {
                            $query = "SELECT * FROM " . s('prefix') . "articles WHERE seftitle = '{$article}'";
                            $shorten = 99990000;
                        } else {
                            if (isset($category)) {
                                $query_catname = "SELECT * FROM " . s('prefix') . "categories";
                                $result_catname = mysql_query($query_catname);
                                while ($r_catname = mysql_fetch_array($result_catname)) {
                                    if (isset($num_cat)) {
                                        $num_cat++;
                                    }
                                    if ($r_catname['seftitle'] == $category) {
                                        $use_cat_id = $r_catname['id'];
                                    }
                                }
                                if ($category == "") {
                                    $use_cat_id = 0;
                                    $category = 0;
                                }
                                if (s('display_new_on_home') == True) {
                                    if ($use_cat_id != 0) {
                                        $query = "SELECT * FROM " . s('prefix') . "articles WHERE position = 1 AND published = 1 AND category = {$use_cat_id} ORDER BY date DESC LIMIT {$article_limit}";
                                    } else {
                                        $query = "SELECT * FROM " . s('prefix') . "articles WHERE position = 1 AND published = 1 ORDER BY date DESC LIMIT {$article_limit}";
                                    }
                                } else {
                                    $query = "SELECT * FROM " . s('prefix') . "articles WHERE position = 1 AND published = 1 AND category = {$use_cat_id} ORDER BY date DESC LIMIT {$article_limit}";
                                }
                                if (isset($r['textlimit'])) {
                                    $shorten = $r['textlimit'];
                                }
                                if (isset($shorten) == 0) {
                                    $shorten = 9999000;
                                }
                            }
                        }
                        $result = mysql_query($query);
                        while ($r = mysql_fetch_array($result)) {
                            if ($article == "") {
                                $shorten = $r['textlimit'];
                                if ($shorten == 0) {
                                    $shorten = 99990000;
                                }
                            }
                            $comments_num = 0;
                            $comment_query = "SELECT * FROM " . s('prefix') . "comments WHERE articleid = {$r['id']}";
                            $comment_result = mysql_query($comment_query);
                            while ($comment_r = mysql_fetch_array($comment_result)) {
                                $comments_num++;
                            }
                            $date = date(s('date_format'), strtotime($r['date']));
                            $fp_date_format = date(s('fp_date_format'), strtotime($r['date']));
                            $position = $r['position'];
                            if ($category == "0") {
                                $category = s('home');
                            }
                            if ($r['displaytitle'] == "YES" and $article == "") {
                                echo "<h2><a href='" . s('website') . find_cat_sef($r['category']) . "/" . $r['seftitle'] . "/'>" . $r['title'] . "</a></h2>";
                            } else {
                                if ($r['displaytitle'] == "YES") {
                                    echo "<h2>" . $r['title'] . "</h2>";
                                }
                            }
                            if ($r['image'] != "") {
                                ?>
				<div class="image">
					<img src="<?php 
                                echo s('website') . s('image_folder');
                                ?>
/<?php 
                                echo $r['image'];
                                ?>
" alt="<?php 
                                echo $r['title'];
                                ?>
" />
				</div><?php 
                            }
                            // PHP files inclusion routine
                            $fulltext = $r['text'];
                            $findme = "[include]";
                            $pos = strpos($fulltext, $findme);
                            $findme = "[/include]";
                            $pos2 = strpos($fulltext, $findme);
                            $file = substr($fulltext, $pos + 9, $pos2 - 9);
                            if ($pos2 > 0) {
                                $text = str_replace("[include]", "|&|", $fulltext);
                                $text = str_replace("[/include]", "|&|", $text);
                                $text = explode("|&|", $text);
                                $num = count($text);
                                for ($i = 0;; $i++) {
                                    if ($i == $num) {
                                        break;
                                    }
                                    if (strpos($text[$i], '.php') === false and strpos($text[$i], '.txt') === false and strpos($text[$i], '.inc') === false) {
                                        echo substr(stripslashes($text[$i]), 0, $shorten);
                                    } else {
                                        include $text[$i];
                                    }
                                }
                            } else {
                                echo substr(stripslashes($fulltext), 0, $shorten);
                            }
                            if (isset($numrows)) {
                                $numrows++;
                            }
                            if ($article == "" and strlen($r['text']) > $shorten) {
                                echo "...</p>";
                            }
                            $commentable = $r['commentable'];
                            if ($r['position'] != 3 and $r['position'] != 4 or isset($_SESSION['Username'])) {
                                if ($article == "") {
                                    if ($r['displayinfo'] == "YES") {
                                        echo "<p class='" . s('date_class') . "'>";
                                        if (strlen($r['text']) > $shorten) {
                                            echo "<img src='" . s('website') . "images/more.gif' alt='' /> <a href='" . s('website') . $category . "/" . $r['seftitle'] . "/'>" . l('read_more') . "</a> ";
                                        }
                                        if ($commentable == "YES" or $commentable == "FREEZ") {
                                            echo "<img src='" . s('website') . "images/comment.gif' alt='' /> <a href='" . s('website') . $category . "/" . $r['seftitle'] . "/'>" . l('comments') . "(" . $comments_num . ")</a> ";
                                        }
                                        echo "<img src='" . s('website') . "images/timeicon.gif' alt='' /> " . $fp_date_format . "</p>";
                                    }
                                } else {
                                    echo "<p class='" . s('date_class') . "'>";
                                    if (isset($_SESSION['Logged_In'])) {
                                        echo l('edit_article') . " [ <a href='" . s('website') . "index.php?action=simpleedit&id={$r['id']}'>" . l('simple') . "</a> <img src='" . s('website') . "images/arrow.gif' alt='|' /> <a href='" . s('website') . "index.php?action=advancededit&id={$r['id']}'>" . l('advanced') . " </a> ] <img src='" . s('website') . "images/arrow.gif' alt='|' /> <a href='" . s('website') . "index.php?action=process&task=delete&id={$r['id']}'" . if_javascript_on(" onclick='return confirm(\"" . l('warning_delete') . "\");'", 'return') . ">" . l('delete_article') . "</a> <img src='" . s('website') . "images/arrow.gif' alt='|' /> ";
                                        if ($r['commentable'] == "FREEZ") {
                                            echo "<a href='" . s('website') . "index.php?action=process&task=unfreezecomments&id={$r['id']}'>" . l('unfreeze_comments') . "</a> <img src='" . s('website') . "images/arrow.gif' alt='|' /> ";
                                        } else {
                                            if ($r['commentable'] != "NO") {
                                                echo "<a href='" . s('website') . "index.php?action=process&task=freezecomments&id={$r['id']}'>" . l('freeze_comments') . "</a> <img src='" . s('website') . "images/arrow.gif' alt='|' /> ";
                                            }
                                        }
                                    }
                                    if ($category != s('home')) {
                                        $category = $category . "/";
                                    }
                                    echo "<a href='" . s('website');
                                    if ($category != s('home')) {
                                        echo $category . "'>";
                                    } else {
                                        echo "'>";
                                    }
                                    echo l('back') . "</a> <img src='" . s('website') . "images/timeicon.gif' alt='' /> " . $date . "</p>";
                                }
                            }
                        }
                    }
                }
            }
            if ($article != "" and $commentable == "YES") {
                comment("unfreezed");
            } else {
                if ($article != "" and $commentable == "FREEZ") {
                    comment("freezed");
                }
            }
    }
}
Example #15
0
<?php

include_once 'functions.php';
$metodo = isset($_POST['method']) ? $_POST['method'] : 'none';
switch ($metodo) {
    case 'contact':
        contact($_POST['name'], $_POST['email'], $_POST['subject'], $_POST['phone'], $_POST['message']);
        break;
    case 'suscribe':
        break;
    case 'none':
        echo json_encode(array('error' => true, 'message' => 'No se específico ningún método'));
        break;
    default:
        echo json_encode(array('error' => true, 'message' => 'Método inválido.'));
        break;
}