示例#1
0
function AskQuestionAdminMail($to, $userEmail, $category, $question, $date)
{
    $res = "-1";
    $mailBody = "";
    try {
        $subject = "MR - Connect Question Asked";
        $headers = "MIME-Version: 1.0" . "\r\n";
        $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
        $headers .= "From: guide@mentored-research.com" . "\r\n";
        // write the mail body here.
        $mailBody .= "<h1>MR - Connect Question Asked</h1><br />";
        $mailBody .= "Dear Admin, " . "<br />";
        $mailBody .= "Following are the details of the question asked on MR-Connect Home: <br /><br />";
        $mailBody .= "Name: <b>" . GetUserName($userEmail) . "</b><br />";
        $mailBody .= "Email Address: <b>" . $userEmail . "</b><br />";
        $mailBody .= "Question Category: <b>" . GetCategoryName($category) . "</b><br />";
        $mailBody .= "Question Asked: <b>" . $question . "</b><br />";
        $mailBody .= "Request on<b>: " . $date . "</b><br />";
        $mailBody .= "<br /><br />Thank You.";
        $mailBody .= "<br />MR - Connect";
        $mailBody .= "<br /><a href='http://mentored-research.com'>Mentored-Research</a>";
        if (mail($to, $subject, $mailBody, $headers) == true) {
            $res = "1";
        } else {
            $res = "-1";
        }
        return $res;
    } catch (Exception $e) {
        $res = "-1";
        return $res;
    }
}
function GetEventText($categoryID, $eventTypeID, $eventName, $eventID)
{
    global $categoryidToSportCodeTable;
    global $sportcodeToEventParagraphTextTemplateTable;
    $event_info = array();
    $text = '';
    $eventName = htmlspecialchars($eventName);
    if ($eventTypeID == 3) {
        $Bsql = "SELECT EventIntroText, EventImagePathname FROM EventText WHERE EventId={$eventID}";
        if ($result = mysql_query($Bsql)) {
            while ($row = mysql_fetch_array($result)) {
                $event_info = array("intro_text" => $row['EventIntroText'], "image_pathname" => $row['EventImagePathname']);
                return $event_info;
            }
        }
        if (array_key_exists($categoryID, $categoryidToSportCodeTable)) {
            $code = $categoryidToSportCodeTable[$categoryID];
            $textTemplate = $sportcodeToEventParagraphTextTemplateTable[$code];
            $text = $textTemplate;
            #mixed str_replace ( mixed $search, mixed $replace, mixed $subject [, int &$count] )
            $text = str_replace("%%EVENT_NAME%%", "{$eventName}", $text);
        } else {
            #		print "Error";
        }
    } else {
        if ($eventTypeID == 2) {
            $categoryName = GetCategoryName($categoryID);
            if ($eventID == 10475) {
                $text = "It's not too late to get your tickets for the next {$eventName} concert.  Ticket availability is constantly changing so don't hesitate to buy your tickets today.  Find the best seats in the house or the love the view from the rafters, either way you can't miss out on your chance to see {$eventName} live.  {$categoryName} concert tickets have been some of the hottest tickets in town no matter who's playing.  So go ahead and click on your local venue and find the best seats available to see {$eventName} now.";
            } else {
                $text = "";
            }
        } else {
            if ($eventTypeID == 4) {
                $text = "";
            } else {
                #	print "Error";
            }
        }
    }
    $event_info = array("intro_text" => $text, "image_pathname" => "");
    return $event_info;
}
function GetEventText($categoryID, $eventTypeID, $eventName, $eventID)
{
    global $categoryidToSportCodeTable;
    global $sportcodeToEventParagraphTextTemplateTable;
    $text = "";
    $eventName = htmlspecialchars($eventName);
    if ($eventTypeID == 3) {
        $Bsql = "SELECT EventIntroText FROM EventText WHERE EventId={$eventID}";
        if ($result = mysql_query($Bsql)) {
            while ($row = mysql_fetch_array($result)) {
                $text = $row['EventIntroText'];
                return $text;
            }
        }
        if (array_key_exists($categoryID, $categoryidToSportCodeTable)) {
            $code = $categoryidToSportCodeTable[$categoryID];
            $textTemplate = $sportcodeToEventParagraphTextTemplateTable[$code];
            $text = $textTemplate;
            #mixed str_replace ( mixed $search, mixed $replace, mixed $subject [, int &$count] )
            $text = str_replace("%%EVENT_NAME%%", "{$eventName}", $text);
        } else {
            #		print "Error";
        }
    } else {
        if ($eventTypeID == 2) {
            $categoryName = GetCategoryName($categoryID);
            $text = "It's not too late to get your tickets for the next {$eventName} concert.  Ticket availability is constantly changing so don't hesitate to buy your tickets today.  Find the best seats in the house or the love the view from the rafters, either way you can't miss out on your chance to see {$eventName} live.  {$categoryName} concert tickets have been some of the hottest tickets in town no matter who's playing.  So go ahead and click on your local venue and find the best seats available to see {$eventName} now.";
        } else {
            if ($eventTypeID == 4) {
                $text = "Theater tickets have always been in high demand, not to mention the happening show of {$eventName} which is selling like hot cakes.  Tickets are available, but prices and availability are changing rapidly.  Find your front row tickets for {$eventName} and buy them today before they go.  We'll see you there. ";
            } else {
                #	print "Error";
            }
        }
    }
    return $text;
}
if (isset($_REQUEST['keywords']) && strlen($_REQUEST['keywords']) < 150) {
    $keywords = $_REQUEST['keywords'];
    $pager_url_params = modify_params($pager_url_params, 'keywords=' . $keywords);
}
if (strlen($pager_url_params) > 0) {
    $pager_url_params = '?' . $pager_url_params;
}
if (strlen($num_prod_url_params) > 0) {
    $num_prod_url_params = '?' . $num_prod_url_params;
}
if (strlen($rank_url_params) > 0) {
    $rank_url_params = '?' . $rank_url_params;
}
if ($dbh) {
    if ($categoryID != '') {
        $categoryName = GetCategoryName($categoryID);
        echo '<h1>' . $categoryName . '</h1>';
        $breadcrumb_str = Breadcrumbs($categoryID, 0);
        echo $breadcrumb_str;
        $subsubcategories = GetImmediateSubordinatesOfCategory($categoryID, -1);
        $suboord = '';
        if (is_array($subsubcategories) && count($subsubcategories) > 0) {
            echo '<br/>Below: ';
            foreach ($subsubcategories as $index => $subsubcategoryArray) {
                $anchor = '
			<a href="http://www.mongotickets.com/event_ranking_editor.php?start=1&categoryID=' . $subsubcategoryArray[id] . '">' . $subsubcategoryArray[name] . '</a>';
                if (strlen($suboord) > 0) {
                    $suboord .= '&nbsp;,&nbsp;';
                }
                $suboord .= $anchor;
            }