21
winsion
Re: imagemanager
  • 2004/6/15 5:12

  • winsion

  • Just popping in

  • Posts: 55

  • Since: 2003/11/23


I had the same thing to make, I give you an example of what I have make :

include("admin_header.php");


$op 'form'


function 
formulaire() {

include 
XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$my_form = new XoopsThemeForm("ALEATOIRE""formulaire""index.php");

$my_form->addElement(new XoopsFormText("Lien""lien"50100$lien), false);
$my_form->addElement(new XoopsFormText("Nom Lien""nomlien"50100$nomlien), false);
$my_form->setExtra"enctype='multipart/form-data'" ) ; 
$img_box = new XoopsFormFile("Image""photo"$max_imgsize);
$img_box->setExtra"size ='50'") ;
$my_form->addElement($img_box); 
$button_tray = new XoopsFormElementTray('' ,'');
$button_tray->addElement(new XoopsFormButton('''post',"Envoyer"'submit'));
$my_form->addElement($button_tray);
$my_form->display();
}

foreach ( 
$_POST as $k => $v ) { 
${
$k} = $v
}
if ( isset(
$post) ) {
$op 'post';
}

switch (
$op) {


case 
"post"
$max_imgsize 100000
$max_imgwidth 500
$max_imgheight 500
$allowed_mimetypes = array('image/gif''image/jpeg''image/pjpeg''image/x-png');
$img_dir XOOPS_ROOT_PATH "/modules/aleatoire/images" ;

include_once(
XOOPS_ROOT_PATH."/class/uploader.php");
$field $_POST["xoops_upload_file"][0] ; 

if( !empty( 
$field ) || $field != "" ) { 


$uploader = new XoopsMediaUploader($img_dir$allowed_mimetypes$max_imgsize$max_imgwidth$max_imgheight);
$uploader->setPrefix'img' ) ;
if( 
$uploader->fetchMedia$field ) && $uploader->upload() ) { 
$photo=$uploader->getSavedFileName();

} else { 
echo 
$uploader->getErrors();
}
}

$sql "INSERT INTO ".$xoopsDB->prefix("aleatoire")." (lien,nomlien,photo) VALUES ('$lien','$nomlien','$photo')";
                
$result=$xoopsDB->queryF($sql); 
              
redirect_header("index.php",1,'Enregistrement effectué');        

break; 

case 
'form':
default:
xoops_cp_header();

formulaire();

xoops_cp_footer();
break;
}



22
winsion
Re: Mediashow problem
  • 2004/6/15 5:08

  • winsion

  • Just popping in

  • Posts: 55

  • Since: 2003/11/23


I looked at. I don't think that comes from the URL (this module use "xoops_url". Once again I think of a problem of chmod. Look at the behavior of the file "video.txt" in the folder "sql", I don't have the impression only it writes the name of the file inside, I am mistaken? Test to change the chmod your folders.

Other module have problem ?(if so, which)

Very nice site !

(edit : for anonymous, see the comment of mediashow download)



23
winsion
Re: Mediashow problem
  • 2004/6/14 15:12

  • winsion

  • Just popping in

  • Posts: 55

  • Since: 2003/11/23


I tried to connect and I was registered on your web site to see what does not function. But even as a member, I don't have the permissions necessary…




24
winsion
Re: parse error in theme.html
  • 2004/6/1 11:41

  • winsion

  • Just popping in

  • Posts: 55

  • Since: 2003/11/23


In debug it's line of template_c defaut%theme.html no ? not theme.html of theme folder ?



25
winsion
Re: Agendax vulnerability
  • 2004/6/1 9:12

  • winsion

  • Just popping in

  • Posts: 55

  • Since: 2003/11/23


I confirm security problem with agendax

One membre of xoops-france was hacked by brasilian hackers.

The blamed file is addevent.inc.php,the variable $agendax_path of this script is obviously not checked



26
winsion
Re: MyAds Unistall Install Problem
  • 2004/6/1 5:07

  • winsion

  • Just popping in

  • Posts: 55

  • Since: 2003/11/23


You cannot install perhaps because the tables of the data bases module already exists

Look on phpmyadmin if there remain tables of myads



27
winsion
Re: Templates in module admin
  • 2004/6/1 5:00

  • winsion

  • Just popping in

  • Posts: 55

  • Since: 2003/11/23


For templates not to forget
$modversion['templates'][1]['file'] = 'templates.html';
$modversion['templates'][1]['description'] = 'Your description';


in xoops_version.php

why you look for templates on admin ?

I understand less the remainder of the question. But for header and footer on admin it's :
xoops_cp_header();
xoops_cp_footer();

Good job



28
winsion
Re: Problems with install
  • 2004/5/30 6:20

  • winsion

  • Just popping in

  • Posts: 55

  • Since: 2003/11/23


Verify your folder's chmod.



29
winsion
Re: I'm looking for a Music Top 10 module
  • 2004/5/29 4:16

  • winsion

  • Just popping in

  • Posts: 55

  • Since: 2003/11/23


I believe that a module under development "xaudio" should correspond so that you ask



30
winsion
Re: Upload Form
  • 2004/5/28 14:23

  • winsion

  • Just popping in

  • Posts: 55

  • Since: 2003/11/23


Example code upload in admin of a module :
<?

include(
"admin_header.php");


$op 'form'


function 
form() {

include 
XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$my_form = new XoopsThemeForm("Upload""form""index.php");
$my_form->setExtra"enctype='multipart/form-data'" ) ; 
$img_box = new XoopsFormFile("Image""photo"$max_imgsize);
$img_box->setExtra"size ='50'") ;
$my_form->addElement($img_box); 
$button_tray = new XoopsFormElementTray('' ,'');
$button_tray->addElement(new XoopsFormButton('''post',"Submit"'submit'));
$my_form->addElement($button_tray);
$my_form->display();
}



foreach ( 
$_POST as $k => $v ) { 
${
$k} = $v
}
if ( isset(
$post) ) {
$op 'post';
}

switch (
$op) {


case 
"post"
$max_imgsize 100000
$max_imgwidth 500
$max_imgheight 500
$allowed_mimetypes = array('image/gif''image/jpeg''image/pjpeg''image/x-png');
$img_dir XOOPS_ROOT_PATH "/modules/mymodule/images" ;

include_once(
XOOPS_ROOT_PATH."/class/uploader.php");
$field $_POST["xoops_upload_file"][0] ; 

if( !empty( 
$field ) || $field != "" ) { 


$uploader = new XoopsMediaUploader($img_dir$allowed_mimetypes$max_imgsize$max_imgwidth$max_imgheight);
$uploader->setPrefix'img' ) ;
if( 
$uploader->fetchMedia$field ) && $uploader->upload() ) { 
$photo=$uploader->getSavedFileName();

} else { 
echo 
$uploader->getErrors();
}
}

    

break; 

case 
'form':
default:
xoops_cp_header();

form();

xoops_cp_footer();
break;
}
?>




TopTop
« 1 2 (3) 4 5 »



Login

Who's Online

227 user(s) are online (153 user(s) are browsing Support Forums)


Members: 0


Guests: 227


more...

Donat-O-Meter

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

Latest GitHub Commits