ciao raga,ho bisogno di un aiuto da un vero esperto in php.
Dunque o scaricato uno script classifieds,di facile installazione per inserire annunci con foto e fin qui nessun problema,il fatto è che io vorrei personalizzarlo,ad esempio vorrei che alcuni dati del form vadano sul sito,tipo foto,descrizione,nome e altri tipo telefono e altre info solo al mio indirizzo,si puo' fare?
foreach ($a2 as $a2_value)
{
$cat_fields[$a2_value]=$ads_fields[$a2_value];
if ($cat_fields[$a2_value][4]=="checkbox")
{
$aa5=split('<option>',$cat_fields[$a2_value][7]);
$i_aa5=0;
foreach ($aa5 as $value1)
{
$i_aa5++;
$namechbx=$a2_value.$i_aa5;
if (($value1!="") and (ereg($value1,$fields_val[$a2_value])))
{$fields_val[$namechbx]="checked";}
if ($ed_add=="submitad") { $title_inf="Place New Ad";}
if ($ed_add=="edit") { $title_inf="Edit Ad ( ID# ".$fields_val['idnum'].") ";}
echo $html_header;
if ($ed_add=='edit')
{
if ($incl_mtmdfile=='yes') $mtmtm1= "or multimedia";
echo "
<table width='550' border=0 bgcolor='#eeeeee' cellspacing=1 cellpadding=0>
<tr><td>
<font FACE='ARIAL, HELVETICA' COLOR='#000099' size='-2'>
<b>
If you need to delete old photo $mtmtm1 file, write char 'd' in the field;
if you do not need to change old file nothing input in the field;
if you need to replace old file, input path to your new file.
</b>
</font>
</td></tr></table>
<p>
";
}
AZZ! una cosa facile! :O
Per la var $table_ads devi mettere il nome della tabella che usi per questo programma.
Posta il file funcs2.php, vediamo se da lì riusciamo a capirci qualcosa...
function getuseradsnum($searchemail)
{
global $table_ads;
$sql_query="select count(idnum) from $table_ads where email='$searchemail' and visible=1";
$sql_res=mysql_query("$sql_query");
$row = mysql_fetch_row($sql_res);
$mcount=$row[0];
return $mcount;
}
function getmbadsnum($mb1_login)
{
global $table_ads;
$sql_query="select count(idnum) from $table_ads where login='$mb1_login' and visible=1";
$sql_res=mysql_query("$sql_query");
$row = mysql_fetch_row($sql_res);
$mcount=$row[0];
return $mcount;
}
function check_email($email)
{
$email=ereg_replace(' ', '', $email);
$a1=split('@', $email);
$a2=split('\.',$email);
if (($a1[0] == "") or ($a1[1] == "") or ($a2[0] == "") or ($a2[1] == ""))
{
$message="
<font FACE='ARIAL, HELVETICA' COLOR='#000000' >
<b> E-mail <font color='#AA0000'> $email</font> has
incorrect format </b>
<font size='-1' color='#000088'>
<p> Please use your browser's <b> back button </b> to return to the form
and fill in these fields.
</font></font>
";
output_message($message);
exit;
}
return $email;
}
function sendpassw($ps_email)
{
global $cat_fields, $table_ads,$adm_email, $ct;
$ps_email=check_email($ps_email);
$sql_query="select idnum, passw, title from $table_ads where email='$ps_email'";
$sql_res=mysql_query("$sql_query");
$kll221="0";
while ($row = mysql_fetch_array ($sql_res))
{
$kll221="1";
$p_message="
Title: ".$row['title'].";
Ad id# ".$row['idnum'].";
Edit/delete password: ".$row['passw'].";
";
$p_subject="Your password";
if ($kll221=="0")
{
$info_message="
E-mail <b> $ps_email </b> does not found in the database
";
output_message($info_message);
exit;
}
$info_message="
login/password info has been sent to your e-mail account
";
output_message($info_message);
exit;
}
function send_mail($idnum)
{
global $pm_message, $pm_email, $pm_subject,
$sendcopytoadm, $redirtoadm, $adm_email, $categories, $cook_login;
$fields_val=get_edit_info($idnum);
$id_email=$fields_val['email'];
$id_num1=$fields_val['idnum'];
$id_title1=$fields_val['title'];
$id_cat1=$fields_val['catname'];
$id_categor1=$categories[$id_cat1][0];
if ($cook_login!='')
{
$mb_login_inf="
This message has been sent by member '$cook_login'
";
}
if (($redirtoadm=='yes') or ($sendcopytoadm=='yes'))
{
$mail_message="
This message from $pm_email to $id_email .
Category:$id_categor1; id#$id_num1; Title:$id_title1
function delete_expired_ads()
{
global $cat_fields, $table_ads, $exp_period ;
$time1=time() - $exp_period*86400;
$sql_query="select idnum from $table_ads where time < $time1";
$sql_res=mysql_query("$sql_query");
while ($row = mysql_fetch_array ($sql_res))
{
$del_id=$row['idnum'];
$sql_query="delete from $table_ads where idnum=$del_id";
mysql_query("$sql_query");
delete_photos($del_id);
}
}
function delete_photos($id)
{
global $photo_path, $multimedia_path, $previewphoto_path, $photos_count;
get_jpg_path($id);
for ($i=1; $i<=$photos_count; $i++)
{
if (file_exists($photo_path[$i])) {unlink($photo_path[$i]);}
}
if (file_exists($previewphoto_path)) {unlink($previewphoto_path);}
if (file_exists($multimedia_path)) {unlink($multimedia_path);}
}
function get_date($time1)
{
$d=getdate($time1);
$date_string=$d['month']." ".$d['mday'].", ".$d['year'];
return $date_string;
}
function get_ad_details($id)
{
global $cat_fields, $table_ads;
$sql_query="select * from $table_ads where idnum=$id";
$sql_res=mysql_query("$sql_query");
$row = mysql_fetch_array ($sql_res);
if ($row['idnum']==""){
$message="
<font FACE='ARIAL, HELVETICA' COLOR='#880000' >
<b>
No Ad with ID# $id
</b>
</font>
";
output_message($message);
exit;
}
if ($row['visible']!=1){
$message="
<font FACE='ARIAL, HELVETICA' COLOR='#880000' >
<b><center>
This ad is inaccessible at present time <br> and will apear
in the index after approving by admin.
</center></b>
</font>
";
output_message($message);
exit;
}
return $row;
}
function get_edit_info($ed_id)
{
global $cat_fields, $table_ads;
$sql_query="select * from $table_ads where idnum=$ed_id";
$sql_res=mysql_query("$sql_query");
$row = mysql_fetch_array ($sql_res);
if ($row['idnum']!=""){
foreach ($row as $key => $value)
{
$row[$key]=ereg_replace("'", "'", $row[$key]);
}
}
return $row;
}
function delete_ad($ed_id)
{
global $table_ads;
$sql_query="delete from $table_ads where idnum=$ed_id";
mysql_query("$sql_query");
delete_photos($ed_id);
$message="
<font FACE='ARIAL, HELVETICA' COLOR='BLACK'>
<b> Your ad has been deleted ! </b>
</font>
";
output_message($message);
exit;
}
function get_cat_count($ct)
{
global $cat_fields, $table_ads, $page, $adsonpage;
$sql_query="select count(idnum) from $table_ads where
catname='$ct' and visible=1";
function get_date_update($ct)
{
global $cat_fields, $table_ads, $page, $adsonpage;
$sql_query="select time from $table_ads where
catname='$ct' and visible=1 order by time desc ";
$sql_res=mysql_query("$sql_query");
$row=mysql_fetch_row($sql_res);
$time1=$row[0];
$date_update=get_short_date($time1);
if ($time1==0) {$date_update="";}
return $date_update;
}