1
Mods & Plugins (Releases & Support) / Re: [MOD] WAP page to download files.
« on: May 10, 2005, 04:16:30 PM »
Thanks! 
Now it works great!

Now it works great!

4images code on GitHub Click here to visit GitHub.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
<?
//Some settings
$url = 'http://www.funzone.it'; //where installed 4images, without traling slash
$title = 'FunZone 4Wap'; //title for wap card
$no_id = 'ID non trovato'; //msg when no id found
$enter_id = 'Inserisci ID'; //msg when user comes
$button = 'Mostra'; //text for button
$footer = 'FunZone.it'; //footer text
$dbhost = "localhost"; //host of database
$dbuser = "XXX"; //database user
$dbpass = "XXX"; //database pass
$dbname = "XXX"; //and database ;]
//dont need to change after this
Header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml_1.2.xml\">";
?>
<wml>
<card title="<? echo $title ?>">
<p align="center">
<form method="post" action="index.php">
<?php
$id = $_REQUEST['id'];
if($id!=""){
$db = mysql_connect("$dbhost", "$dbuser", "$dbpass") or die ("Error");
@mysql_select_db("$dbname", $db) or die ("DB not found");
$result = mysql_query("SELECT image_id, image_media_file, cat_id, image_name FROM 4images_images where image_id=$id");
$row = mysql_fetch_array($result);
$image_id = $row["image_id"];
$cat_id = $row["cat_id"];
$image_name = $row["image_name"];
if ($image_id!=""){
$image_media_file = $row["image_media_file"];
?>
<a href="<? echo $url;?>/data/media/<? echo $cat_id;echo "/";echo $image_media_file; ?>"><? echo $image_name;?></a><br />
<?php }
else { echo $no_id; } }
else { echo $enter_id; }
?>
<br />
<input name="id" type="text" id="id" size="6" /><br />
<input name="submit" type="submit" value="<? echo $button ?>" />
</form>
<br />
<small>® <? echo $footer ?></small>
</p>
</card>
</wml>