171
urbanspacema
A module lik e 'imageshark'

... to store the image in our server like a procedure of 'imageshack'....

exist?


At this link is one argument on this hack.
http://www.xoopsitalia.org/modules/newbb/viewtopic.php?topic_id=7985&post_id=39013#forumpost39013

TNX
http://www.ultrasonica.it
http://www.noisecollective.net



172
urbanspacema
question on module modification

I have created the code that allows me to load a picture in a folder on the server.I would have to insert the name of the picture loaded inside the db. the voice in table where it goes loaded this name is 'release_image'.

the code that use is this but does not work

file submit.php
include("header.php");
include 
'../mainfile.php'
include_once 
XOOPS_ROOT_PATH.'/class/uploader.php';

//aggiunta

$release_image = isset($_POST['upload_file']) ? $_POST['upload_file'] : array();

//Imposto i tipi di file autorizzati 
$allowed_mimetypes = array('image/gif''image/jpeg''image/pjpeg''image/x-png');
// Massimo peso 
$maxfilesize 100000;
//larghezza e lunghezza
$maxfilewidth 150;
$maxfileheight 150;

//Richiamo la classe uploader e gli passo i parametri inizializzati 
//Nota: il primo parametro è il nome della cartella dove verrà salvato il file. In questo caso la cartella è nella stessa dierctory di questo file
$uploader = new XoopsMediaUploader(XOOPS_ROOT_PATH.'/uploads/copertine'$allowed_mimetypes$maxfilesize$maxfilewidth$maxfileheight);
//imposto un prefisso per l'immagine
$uploader->setPrefix('img');
//Upload del file
if ($uploader->fetchMedia($release_image[0])) {
if (!
$uploader->upload()) {
//Errori?
echo $uploader->getErrors();
} else {
//Tutto OK!
echo 'File caricato con successo!';
echo 
'File salvato come: ' $uploader->getSavedFileName() . '';
echo 
'Path completa: ' $uploader->getSavedDestination(). '';
echo 
'Nome del file: ' $uploader->getMediaName(). '';
echo 
'Tipo di file: ' $uploader->getMediaType(). '';
echo 
'Peso: ' $uploader->getMediaSize(). '';
echo 
'Nome file temporaneo: ' $uploader->getMediaTmpName(). '';
echo 
'Directory dove è stato salvato: ' $uploader->getSavedDestination(). '';}
} else {
echo 
$uploader->getErrors();
}


$myts =& MyTextSanitizer::getInstance();

$xoopsOption['show_rblock'] =0;
include(
XOOPS_ROOT_PATH."/header.php");

//Global $xoopsUser, $xoopsConfig;

$op "submit";

if (isset(
$HTTP_GET_VARS)) {
   foreach (
$HTTP_GET_VARS as $k => $v) {
      $
$k $v;
   }
}

if (isset(
$HTTP_POST_VARS)) {
   foreach (
$HTTP_POST_VARS as $k => $v) {
      $
$k $v;
   }
}

if (!empty(
$contents_preview)) {
   
$myts =& MyTextSanitizer::getInstance();
   
   
//OpenTable();
   
   //echo ""._XD_CATEGORY.": ".$category_id;
        
   
$html = empty($review_nohtml) ? 0;
   
$smiley = empty($review_nosmiley) ? 0;
   
$xcode = empty($review_noxcode) ? 0;
   
$p_title $myts->makeTboxData4Preview($review_title);
   
$p_item $myts->makeTboxData4Preview($review_item);
   
$p_label $myts->makeTboxData4Preview($review_label);
   
$p_release $myts->makeTboxData4Preview($release_date);
   
$p_format $myts->makeTboxData4Preview($release_format);
   
$p_contents $myts->makeTareaData4Preview($review_contents$html$smiley$xcode);
   
$p_image $myts->makeTboxData4PreviewInForm($release_image);

   echo
"<table border='0' cellpadding='3' cellspacing='0' valign='top' width='100%'><tr><td class='bg2'>
   <table width='100%' border='0' cellpadding='4' cellspacing='1'>
   <tr class='bg3' align='center'><td align='left'>
$p_title</td></tr>
   <tr class='bg3' align='center'><td align='left'>
$p_item</td></tr>
   <tr class='bg3' align='center'><td align='left'>
$p_label</td></tr>
   <tr class='bg3' align='center'><td align='left'>
$p_release</td></tr>
   <tr class='bg3' align='center'><td align='left'>
$p_format</td></tr>
   <tr class='bg3' align='center'><td align='left'>
$p_image</td></tr>
   <tr class='bg1'><td>
$p_contents</td></tr></table></td></tr></table><br />";
   
$review_title $myts->makeTboxData4PreviewInForm($review_title);
   
$review_item $myts->makeTboxData4PreviewInForm($review_item);
   
$review_label $myts->makeTboxData4PreviewInForm($review_label);
   
$release_date $myts->makeTboxData4PreviewInForm($release_date);
   
$release_format $myts->makeTboxData4PreviewInForm($release_format);
   
$release_image $myts->makeTboxData4PreviewInForm($release_image);
   
$review_contents $myts->makeTareaData4PreviewInForm($review_contents);
   include(
"contentsform.php");
   
//CloseTable();
   
include (XOOPS_ROOT_PATH."/footer.php");
   
   exit();
}

if (
$op == "submit") {
   
OpenTable();
   
$myts =& MyTextSanitizer::getInstance();
   
//echo "<h4 style='text-align:left;'>"._XD_ADDCONTENTS."</h4>";
   
$review_title "";
   
$review_contents "";
   
$review_item ="";
   
$review_label ="";
   
$release_date ="";
   
$release_format ="";
   
$release_image "";
   
$review_visible 0;
   
$review_nohtml 0;
   
$review_nosmiley 0;
   
$review_noxcode 0;
   
$review_id 0;
   
$category_id 0;
   
$op "addcontentsgo";
   include(
"contentsform.php");
   
CloseTable();
   include (
XOOPS_ROOT_PATH."/footer.php");
   exit();
}

if (
$op == "addcontentsgo") {
   
OpenTable();
   
$myts =& MyTextSanitizer::getInstance();
   
$title $myts->makeTboxData4Save($review_title);
   
$item $myts->makeTboxData4Save($review_item);
   
$label $myts->makeTboxData4Save($review_label);
   
$release $myts->makeTboxData4Save($release_date);
   
$format $myts->makeTboxData4Save($release_format);
   
$image $myts->makeTboxData4Save($release_image);
   
$contents $myts->makeTareaData4Save($review_contents);   
   
/*
   $result = $xoopsDB->query("SELECT category_id, category_title FROM ".$xoopsDB->prefix("lykos_reviews_categories")."");
   while(list($cat,$cat_title) = $xoopsDB->fetchRow($result)) {
      if($category_id==$cat_title) {
         $category_id=$cat;
      }
   }
   */
   
 
 

   
$category_id $myts->makeTareaData4Save($category_id);   
   if(
$xoopsUser->uid()) {
      
$submitter $xoopsUser->uid();
   } else {
      
$submitter 0;
   }
   
   
$newid $xoopsDB->genId($xoopsDB->prefix("lykos_reviews_contents")."_review_id_seq");
   
$sql "INSERT INTO ".$xoopsDB->prefix("lykos_reviews_contents")." (review_id, category_id, review_title, review_item, review_label, release_date, release_format, release_image, review_contents, review_uid, review_time,  review_visible, review_nohtml, review_nosmiley, review_noxcode) VALUES (".$newid.", ".$category_id.", '".$title."', '".$item."', '".$label."', '".$release."',  '".$format."', '".$image."', '".$contents."', '".$submitter."',".time().",  ".intval($review_visible).", ".intval($review_nohtml).", ".intval($review_nosmiley).", ".intval($review_noxcode).")";
   if (!
$xoopsDB->query($sql)) {
      echo 
"Impossibile aggiungere contenuti";
      
CloseTable();
      include (
XOOPS_ROOT_PATH."/footer.php");
   } else {
      
redirect_header("index.php",1,_XD_DBSUCCESS);
   }
   exit();
}


?>


the file with the form:contentsform.php

echo "<form action='submit.php' method='post' enctype='multipart/form-data' />";
echo 
"<table border='0' cellpadding='0' cellspacing='0' valign='top' width='100%'><tr><td class='bg2'>";
echo 
"<table width='100%' border='0' cellpadding='4' cellspacing='1'>";
echo 
"<tr><td nowrap='nowrap' class='bg3'>"._XD_QUESTION." </td><td class='bg1'><input type='text' name='review_title' value='$review_title' size='31' maxlength='255' /></td></tr>";

echo 
"<tr><td nowrap='nowrap' class='bg3'>"._XD_CATEGORY."</td><td class='bg1'><select name="category_id">";
$a=0;
$result $xoopsDB->query("SELECT category_id, category_title FROM ".$xoopsDB->prefix("lykos_reviews_categories")."");
while(list(
$cat_id,$cat_title) = $xoopsDB->fetchRow($result)) {
   if(
$cat_id==$category_id) {
      echo 
"<option value="$cat_id" selected>$cat_title</option>n";   
      
$a=1;
   }
   else {
      echo 
"<option value="$cat_id">$cat_title</option>n";
   }
}
if(
$a==1) {
   echo
"<option selected>[Choose Category]";
}
echo 
"</select></td></tr>";


echo 
"<tr><td nowrap='nowrap' class='bg3'>"._XD_ITEM." </td><td class='bg1'><input type='text' name='review_item' value='$review_item' size='31' maxlength='255' /></td></tr>";
echo 
"<tr><td nowrap='nowrap' class='bg3'>"._XD_LABEL." </td><td class='bg1'><input type='text' name='review_label' value='$review_label' size='31' maxlength='255' /></td></tr>";
echo 
"<tr><td nowrap='nowrap' class='bg3'>"._XD_RELEASE." </td><td class='bg1'><input type='text' name='release_date' value='$release_date' size='31' maxlength='255' /></td></tr>";
echo 
"<tr><td nowrap='nowrap' class='bg3'>"._XD_FORMAT." </td><td class='bg1'><input type='text' name='release_format' value='$release_format' size='31' maxlength='255' /></td></tr>";

echo 
"<tr><td nowrap='nowrap' class='bg3'><input type='hidden' name='MAX_FILE_SIZE' value='100000' />";
echo 
"<tr><td nowrap='nowrap' class='bg3'>"._XD_IMAGE."</td><td class='bg1'><input type='file' name='image_file' value='$release_image' size='31' maxlength='255' /><br /></td></tr>";
echo 
"<tr><td nowrap='nowrap' class='bg3'><input type='hidden' name='upload_file[]' id='upload_file[]' value='image_file' />";
//oldfield 
echo "<input type='hidden' name='release_image' value='".$release_image."' size='31' maxlength='255' /></td></tr>";

echo 
"<tr><td nowrap='nowrap' class='bg3'>"._XD_AMAZN." </td><td class='bg1'><input type='text' name='release_amazon' value='".$review_amazon."' size='31' maxlength='255' /></td></tr>";
$checked = ($review_visible == 1) ? " checked='checked'" "";
echo 
"<tr><td nowrap='nowrap' class='bg3'>"._XD_DISPLAY." </td><td class='bg1'><input type='checkbox' name='review_visible' value='1'$checked /></td></tr>";
echo 
"<tr><td nowrap='nowrap' class='bg3'>"._XD_ANSWER." </td><td class='bg1'>";

include_once(
XOOPS_ROOT_PATH."/include/xoopscodes.php");

xoopsCodeTarea("review_contents"3920);
xoopsSmilies("review_contents");
$checked = ($review_nohtml == 1) ? " checked='checked'" "";

echo 
"<br /><input type='checkbox' name='review_nohtml' value='1'$checked />"._XD_NOHTML."<br />";

$checked = ($review_nosmiley == 1) ? " checked='checked'" "";

echo 
"<input type='checkbox' name='review_nosmiley' value='1'$checked />"._XD_NOSMILEY."<br />";

$checked = ($review_noxcode == 1) ? " checked='checked'" "";

echo 
"<input type='checkbox' name='review_noxcode' value='1'$checked />"._XD_NOXCODE."</td></tr>";
echo 
"<tr><td nowrap='nowrap' class='bg3'>&nbsp;</td><td class='bg1'><input type='hidden' name='review_id' value='".$review_id."' /><input type='hidden' name='op' value='$op' /><input type='submit' name='contents_preview' value='"._PREVIEW."' />&nbsp;<input type='submit' name='contents_submit' value='"._SUBMIT."' /></td></tr>";
echo 
"</table></td></tr></table></form>";
include(
"image_uploader.php");
?>



all the contents of the form come send to db except the name of the picture. Opening the sql file of the database to the place of the name I obtain only an empty space: "" in place of “picture.jpg”. where is the error? Thanks
http://www.ultrasonica.it
http://www.noisecollective.net



173
urbanspacema
Re: Ephemerids -" Today in the history " with Tiny Event Version 1.01

Hello, someone has made the modification demanded from martyboy?
http://www.ultrasonica.it
http://www.noisecollective.net



174
urbanspacema
Re: module for 'history notice'

Thanks!!
Grazie!!

Francesco.
http://www.ultrasonica.it
http://www.noisecollective.net



175
urbanspacema
Re: module for 'history notice'

up!
http://www.ultrasonica.it
http://www.noisecollective.net



176
urbanspacema
Re: module for 'history notice'

ok, but the 'daily notice' must be inserted by my staff...
http://www.ultrasonica.it
http://www.noisecollective.net



177
urbanspacema
Re: module for 'history notice'

Any IDEA?
http://www.ultrasonica.it
http://www.noisecollective.net



178
urbanspacema
Re: module for 'history notice'

yes, but random quote don't show a specific tips in a specific day...

and XHLD and Planet, are a rss aggregator... in wich way they go used for making a "This day in history"?

Tnx
http://www.ultrasonica.it
http://www.noisecollective.net



179
urbanspacema
module for 'history notice'

Hello, i need a module tath show a specific quote in a specific day

ex.

13 november
1960 - Sammy Davis, Jr. marries Swedish actress May Britt. Interracial marriage was still illegal in 31 US states out of 50.

1971 - The American space probe, Mariner 9, has become the first spacecraft to orbit another planet, swinging into its planned trajectory around Mars without a hitch.

...

Thank
Francesco
http://www.ultrasonica.it
http://www.noisecollective.net



180
urbanspacema
Re: More than one banner?

hello I am trying the module "rw_banner" and I wanted to know like I can make in order to modify the template of block.

use a translator excused my English
http://www.ultrasonica.it
http://www.noisecollective.net




TopTop
« 1 ... 15 16 17 (18) 19 »



Login

Who's Online

94 user(s) are online (59 user(s) are browsing Support Forums)


Members: 0


Guests: 94


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits