je suis nouveau sur le forum, je ne vois pas de topic de présentation, donc je le fais now ^^
j'ai 19 ans et je suis freelance. Je m'intéresse donc à AJAX. Je suis à la recherche d'une formation de conception web.
Bref voici mon problème :
Je viens tout juste de faire l'acquisition d'un script de rencontre (abledating). A ma grande surprise, le script ne correspond pas à mes attentes. Donc étant donné le prix de celui ci, j'ai commencé à faire mon propre template. Ce script est sous la forme :
- script php dans un dossier
- template : 2 dossiers { un dossier public , c'est à dire quand on n'est pas connecté, et un dossier private quand on est connecté)
Je voudrais donc ajouter sur la page public c'est à dire la page index : les membres fêtant leur anniversaires, les 5 derniers vidéos, blog...
En général tout sa est déjà codé, et visible dans la partie private.
Je suis donc aller voir directement dans le dossier ou se trouve les codes PHP, j'ai donc mon fichier user birthdays.php :
<?php
/* (C) ABK-Soft Ltd., 2004-2008
IMPORTANT: This is a commercial software product
and any kind of using it must agree to the ABK-Soft
Ltd. license agreement.
It can be found at http://abk-soft.com/license.doc
This notice may not be removed from the source code. */
include("./_include/core/main_start.php");
$page = new CHtmlBlock("", $g['tmpl']['dir_tmpl_main'] . "users_birthdays.html");
$header = new CHeader("header", $g['tmpl']['dir_tmpl_main'] . "_header.html");
$page->add($header);
$footer = new CFooter("footer", $g['tmpl']['dir_tmpl_main'] . "_footer.html");
$page->add($footer);
$type = get_param("display", "info");
if ($type == "info") $list = new CUsersInfo("users_list", $g['tmpl']['dir_tmpl_main'] . "_list_users_info.html");
elseif ($type == "gallery") $list = new CUsersGallery("users_list", $g['tmpl']['dir_tmpl_main'] . "_list_users_gallery.html");
elseif ($type == "list") $list = new CUsersList("users_list", $g['tmpl']['dir_tmpl_main'] . "_list_users_list.html");
elseif ($type == "profile") $list = new CUsersProfile("users_list", $g['tmpl']['dir_tmpl_main'] . "_profile.html");
elseif ($type == "photo") $list = new CHtmlUsersPhoto("users_list", $g['tmpl']['dir_tmpl_main'] . "_photo.html");
else
{
redirect("users_online.php");
}
$list->m_sql_where = "u.user_id!=" . $g_user['user_id'] . " AND orientation=" . $g_user['p_orientation'] . " AND hide_time=0 AND (DAYOFMONTH(birth)=DAYOFMONTH(now()) AND MONTH(birth)=MONTH(now()))";
$list->m_sql_order = "near DESC, user_id";
$page->add($list);
$search = new CSearch("search", $g['tmpl']['dir_tmpl_main'] . "_search.html");
$page->add($search);
$users_ims = new CIms("ims", $g['tmpl']['dir_tmpl_main'] . "_ims.html");
$page->add($users_ims);
include("./_include/core/main_close.php");
?>
Est-ce donc une solution de l'inclure directement dans la page de mon template ? ou fais-je erreur ?mon template et sous cette forme :
Code : Tout sélectionner
{header}
<!-- begin_users -->
<!--<script language="JavaScript" type="text/javascript">
uh=document.getElementById("uh");
ua=document.getElementById("ua");
ua.style.visible="hide";
drag_users=new Drag();
drag_users.init(uh,ua);
</script>-->
<div id="ua" class="fmembers" style="top: 170px; left: 45%; margin-left: -120px;">
<div id="uh" class="fmembers-bg"></div>
<ul class="people">
<!-- begin_user -->
<li>
<dl>
<dt><a href="{url_main}search_results.php?display=profile&name={name}"><img src="{url_files}photo/{photo}" width="62" height="70" alt=""></a></dt>
<dd>{name}, {age}</dd>
</dl>
</li>
<!-- begin_newline -->
<!-- end_newline -->
<!-- end_user -->
</ul>
</div>
<!-- end_users -->
<!-- begin_search -->
<div class="fsearch" style="top: 360px; left: 45%; margin-left: -120px;">
<div class="fsearch-bg"></div>
<form method="GET" action="{url_main}search_results.php">
{l_i_am} <select name="p_orientation[]" style="width: 170px;">{orientation_options}</select><br>
{l_from} <select name="p_age_from" style="width: 45px;">{p_age_from_options}</select>
{l_to} <select name="p_age_to" style="width: 45px;">{p_age_to_options}</select> {l_years_old}
<input type="submit" value=" " class="btn">
</form>
</div>
<!-- end_search -->
<div id="main">
<div class="box-m"><div class="tl-m"><div class="tr-m"><div class="bl-m"><div class="br-m">
<div id="sp-1"><div id="sp-2"><div id="sp-3"><!-- --></div><div id="sp-4"><img src="{url_tmpl_main}images/bg-sp-2.jpg" width="217" height="191" alt="" /></div><div id="sp-5"><img src="{url_tmpl_main}images/bg-sp-3.png" width="226" height="343" alt="" class="png" /></div>
<!-- begin_join -->
<script language="JavaScript" type="text/javascript">
function onValidateJoinForm() {
var form = document.forms['JoinForm'];
// "join_handle" field validation.
if (!(validateRequiredField(form['join_handle'], '{l_username}'))) {
removeSubmissionBlock();
return false;
}
// "join_handle" field validation.
if (!(validateMinLength(form['join_handle'], '{l_username}','4'))) {
removeSubmissionBlock();
return false;
}
// "join_handle" field validation.
if (!(validateMaxLength(form['join_handle'], '{l_username}','20'))) {
removeSubmissionBlock();
return false;
}
// "join_handle" field validation.
if (!(validateAlphaNumeric(form['join_handle'], '{l_username}'))) {
removeSubmissionBlock();
return false;
}
// "join_handle" field validation.
if (!(validateRequiredField(form['join_handle'], '{l_username}'))) {
removeSubmissionBlock();
return false;
}
// "join_handle" field validation.
if (!(validateMinLength(form['join_handle'], '{l_username}','4'))) {
removeSubmissionBlock();
return false;
}
// "join_handle" field validation.
if (!(validateMaxLength(form['join_handle'], '{l_username}','20'))) {
removeSubmissionBlock();
return false;
}
// "join_handle" field validation.
if (!(validateAlphaNumeric(form['join_handle'], '{l_username}'))) {
removeSubmissionBlock();
return false;
}
// "join_password" field validation.
if (!(validateRequiredField(form['join_password'], '{l_password}'))) {
removeSubmissionBlock();
return false;
}
// "join_password" field validation.
if (!(validateMinLength(form['join_password'], '{l_password}','6'))) {
removeSubmissionBlock();
return false;
}
// "join_password" field validation.
if (!(validateMaxLength(form['join_password'], '{l_password}','15'))) {
removeSubmissionBlock();
return false;
}
// "join_password" field validation.
if (!(validateAlphaNumeric(form['join_password'], '{l_password}'))) {
removeSubmissionBlock();
return false;
}
// "join_password" field validation.
if (!(validateRequiredField(form['join_password'], '{l_password}'))) {
removeSubmissionBlock();
return false;
}
// "join_password" field validation.
if (!(validateMinLength(form['join_password'], '{l_password}','6'))) {
removeSubmissionBlock();
return false;
}
// "join_password" field validation.
if (!(validateMaxLength(form['join_password'], '{l_password}','15'))) {
removeSubmissionBlock();
return false;
}
// "join_password" field validation.
if (!(validateAlphaNumeric(form['join_password'], '{l_password}'))) {
removeSubmissionBlock();
return false;
}
// "join_password" field validation.
if (!(validateNotTwoFields(form['join_password'],'{l_password}',form['join_handle'],'{l_username}'))) {
removeSubmissionBlock();
return false;
}
// "verify_password" field validation.
if (!(validateTwoFields(form['verify_password'],'{l_verify_password}',form['join_password'],'{l_password}'))) {
removeSubmissionBlock();
return false;
}
// "email" field validation.
if (!(validateRequiredField(form['email'], '{l_email_address}'))) {
removeSubmissionBlock();
return false;
}
// "email" field validation.
if (!(validateMaxLength(form['email'], '{l_email_address}','100'))) {
removeSubmissionBlock();
return false;
}
// "email" field validation.
if (!(validateEmailField(form['email'], '{l_email_address}'))) {
removeSubmissionBlock();
return false;
}
// "verify_email" field validation.
if (!(validateRequiredField(form['verify_email'], '{l_verify_email}'))) {
removeSubmissionBlock();
return false;
}
// "verify_email" field validation.
if (!(validateMaxLength(form['verify_email'], '{l_verify_email}','100'))) {
removeSubmissionBlock();
return false;
}
// "verify_email" field validation.
if (!(validateEmailField(form['verify_email'], '{l_verify_email}'))) {
removeSubmissionBlock();
return false;
}
// "verify_email" field validation.
if (!(validateTwoFieldsIgnoreCase(form['verify_email'],'{l_verify_email}',form['email'],'{l_email_address}'))) {
removeSubmissionBlock();
return false;
}
// "orientation" field validation.
if (!(validateRequiredSelect(form['orientation'],'{l_orientation}','00'))) {
removeSubmissionBlock();
return false;
}
// "orientation" field validation.
if (!(validateRequiredField(form['orientation'], '{l_orientation}', '00'))) {
removeSubmissionBlock();
return false;
}
// "country" field validation.
if (!(validateRequiredSelect(form['country'],'{l_country}','-1'))) {
removeSubmissionBlock();
return false;
}
// "country" field validation.
if (!(validateRequiredField(form['country'], '{l_country}', '-1'))) {
removeSubmissionBlock();
return false;
}
// "month" field validation.
if (!(validateRequiredField(form['month'], '{l_month}'))) {
removeSubmissionBlock();
return false;
}
// "day" field validation.
if (!(validateRequiredField(form['day'], '{l_day}'))) {
removeSubmissionBlock();
return false;
}
// "year" field validation.
if (!(validateRequiredField(form['year'], '{l_year}'))) {
removeSubmissionBlock();
return false;
}
// "privacy_policy" field validation.
if (!(validateRequiredCheckbox(form['privacy_policy'],'','{l_agree_privete_policy}'))) {
removeSubmissionBlock();
return false;
}
return true;
}
function validateJoinForm() {
blockSubmission = true;
if (typeof beforeJoinFormValidation != 'undefined') {
beforeJoinFormValidation();
}
var validated = onValidateJoinForm();
if (validated && (typeof uponSuccessfulJoinFormValidation != 'undefined')) {
validated = uponSuccessfulJoinFormValidation();
}
else if (!validated && (typeof uponUnsuccessfulJoinFormValidation != 'undefined')) {
uponUnsuccessfulJoinFormValidation();
}
if (!validated) {
removeSubmissionBlock();
}
return validated;
}
function submitJoinForm() {
if (validateJoinForm()) document.JoinForm.submit();
else return false;
}
</script>
<div id="cont">
<form name="JoinForm" method="post" action="{url_main}join.php" onsubmit="return validateJoinForm();">
<h2 id="t-join"><span>{l_join_now}</span></h2>
<label for="username">{l_username}:</label><input type="text" id="username" name="join_handle" /><br />
<label for="create-password">{l_create_password}:</label><input type="password" id="create-password" name="join_password" /><br />
<label for="re-password">{l_reenter_password}:</label><input type="password" id="re-password" name="verify_password" /><br />
<label for="email">{l_email}:</label><input type="text" id="email" name="email" /><br />
<label for="re-email">{l_reemail}:</label><input type="text" id="re-email" name="verify_email" /><br />
<label for="iam">{l_i_am}:</label>
<select name="orientation" id="iam">
{orientation_options}
</select>
<br />
<label for="from">{l_from}:</label>
<select name="country" id="from">
<option value="-1" selected="selected">{l_country_select}</option>
{country_options}
</select>
<br />
<label for="month">{l_born_on}:</label>
<select name="month" id="month" onchange="updateDay('month','JoinForm','year','month','day')">
{month_options}
</select>
<select name="day" id="day">
{day_options}
</select>
<select name="year" id="year" onchange="updateDay('year','JoinForm','year','month','day')">
{year_options}
</select>
<br />
<a onclick="submitJoinForm();"><img src="{url_tmpl_main}images/btn-join.gif" id="btn-join" alt="{l_join_now}" /></a><br />
<input type="checkbox" value="true" name="privacy_policy"
checked><span class="note">{l_i_agree} <a
href="javascript:winpop('{url_tmpl_main}popup/term_cond.html','960','600','yes');" tabindex="17">{l_terms_and_conditions}</a> and <a
href="javascript:winpop('{url_tmpl_main}
popup/priv_policy.html','960','600','yes');" tabindex="18">{l_privacy_policy}</a></span>
</form>
</div>
<!-- end_join -->
</div></div>
</div></div></div></div></div>
</div>
{footer}
*EDIT*
je vais utiliser le même bout de code que l'index private utilise ^^ en esperant qu'il n'y a pas de problème au niveau de la connexion obligatoire.