
Ruzzas
Members-
Posts
180 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
Ruzzas's Achievements

Newbie (1/5)
0
Reputation
-
No errors, I'm having trouble spotting the errors because of such a slow website.
-
Uhmm, I do not understand why this was moved here because I coded this myself, Its just implemented with Joomla. If you could move it back, thanks!
-
If you guys noticed, He's trying to update not insert...
-
I am trying to make a file upload to a directory and then just simply upload it to a remote connection. The problem is, Well... I honestly don't know... I'm good with PHP overall but when it comes to Joomla, I turn into a curious monkey. function UploadToRemote($tempFile,$targetPath,$targetFile){ global $jlistConfig; ignore_user_abort(true); set_time_limit(3600); $conn = ftp_connect($jlistConfig['ftp.address']) or die('FTP Connection failed'); $login = ftp_login($conn,$jlistConfig['ftp.username'],$jlistConfig['ftp.password']) or die('FTP Login failed'); if(!ftp_chdir($conn,$targetPath)){ if(ftp_mkdir($conn,$targetPath)){ ftp_chdir($conn,$targetPath); }else{ $success = 0; } if(ftp_put($conn,$targetFile,$tempFile,FTP_BINARY)){ $success = 1; }else{ die('Failed uploading the file...'); } } ftp_close($conn); return $success; } //datei upload bearbeiten if($file_upload['tmp_name']!=''){ // replace special chars in filename $filename_new = checkFileName($file_upload['name']); $upload_dir = '/'.$jlistConfig['files.uploaddir'].'/'.$mark_catdir.'/'; $ftp_dir = '/'.$jlistConfig['ftp.folder'].'/'.$mark_catdir.'/'; $dir_and_filename = str_replace('/'.$jlistConfig['files.uploaddir'].'/', '', $upload_dir.$filename_new); $target_path = JPATH_SITE.$upload_dir.$filename_new; // upload only when the file not exist in the directory if(!is_file($target_path)){ if(@move_uploaded_file($file_upload['tmp_name'], $target_path)){ $Upload = UploadToRemote($file_upload['tmp_name'], $jlistConfig['ftp.folder'].'/'.$mark_catdir.'/', $jlistConfig['ftp.folder'].'/'.$mark_catdir.'/'.$filename_new) or die('Failed to upload...'); // get filesize $size = fsize($target_path); // get filedate $date_added = JHTML::_('date', 'now', '%Y-%m-%d %H:%M:%S' ); $url_download = basename($target_path); $url_download = utf8_encode($url_download); // auto publish ? if($jlistConfig['upload.auto.publish']){ $publish = 1; setAUPPointsUploads($submitted_by, $filetitle); $set_aup_points = 0; }else{ $set_aup_points = 1; $publish = 0; } $file_extension = strtolower(substr(strrchr($url_download,"."),1)); $filepfad = JPATH_SITE.'/images/jdownloads/fileimages/'.$file_extension.'.png'; if(file_exists(JPATH_SITE.'/images/jdownloads/fileimages/'.$file_extension.'.png')){ $filepic = $file_extension.'.png'; }else{ $filepic = $jlistConfig['file.pic.default.filename']; } $database->setQuery("INSERT INTO #__jdownloads_files (`file_id`, `file_title`, `file_alias`,`description`, `description_long`, `file_pic`, `thumbnail`, `thumbnail2`, `thumbnail3`, `price`, `release`, `language`, `system`, `license`, `url_license`, `size`, `date_added`, `file_date`, `url_download`, `url_home`, `author`, `url_author`, `created_by`, `created_mail`, `modified_by`, `modified_date`, `submitted_by`, `set_aup_points`, `downloads`, `cat_id`, `ordering`, `published`, `checked_out`, `checked_out_time`) VALUES (NULL, '$filetitle', '$file_alias', '$description', '$description_long', '$filepic', '$thumbnail', '$thumbnail2', '$thumbnail3', '$price', '$version', '$language_sel', '$system_sel', '$license_sel', '', '$size', '$date_added', '', '$url_download', '$author_url', '$author', '', '$name', '$mail', '', '0000-00-00 00:00:00', '$submitted_by', '$set_aup_points', '0', '$catlist_sel', '0', '$publish', '0', '0000-00-00 00:00:00')"); if(!$database->query()){ // fehler beim erstellen in DB echo $database->stderr(); exit; } // alles OK! if(!$msg){ $msg = '<div>'.$upload_ok_pic.'<font color="green"> ' .JText::_('JLIST_FRONTEND_UPLOAD_OK'). '</font><br /> </div>'; $html_form = str_replace('{form}', '{msg}{form}', $html_form); // send email wenn aktiviert if($jlistConfig['send.mailto.option.upload']){ sendMailUploads($name, $mail, $url_download, $filetitle, $description); } } }else{ // fehler beim verschieben $msg = '<div>'.$upload_stop_pic.'<font color="red"> ' .JText::_('JLIST_FRONTEND_UPLOAD_ERROR_MOVE_FILE'). '</font><br /> </div>'; $html_form = str_replace('{form}', '{msg}{form}', $html_form); } }else{ // file exist with the same name $msg = '<div>'.$upload_stop_pic.'<font color="red"> ' .JText::_('JLIST_FRONTEND_UPLOAD_ERROR_FILE_EXISTS'). '</font><br /> </div>'; $html_form = str_replace('{form}', '{msg}{form}', $html_form); } } Please help me!
-
I did not know this, Thank you Mr wildteen88.
-
Yes indeedy, What is this? $Module['Core'] = new panel_core();
-
It's a printf problem, Without it, it seems to work fine. But I want it with printf so I can chuck it in my settings for easy configuration.
-
Try class bot_restart { function __construct( ) { $ServersReturned = mysql_query("SELECT * FROM xhost_boxs"); $CurrentServers = mysql_fetch_array($ServersReturned); while($CurrentServers !== false) { echo $CurrentServers['box_id']; } } }
-
If you read the code: <?php print_r($Log); ?>
-
Yeah... Didn't make no difference, Whatsoever Also: <td>Freshly downloaded: PewPew revision: 038</td> Array ( [Name] => PewPew [TimeStamp] => 1280744518 [Revision1] => 0 [Revision2] => 376 ) </tr> if($Log['Revision1']&&$Log['Revision2']){ $Message = 'Updated %1$s from revision: %3$s to revision: %4$d'; }else{ $Message = 'Freshly downloaded: %1$s revision: %3$d'; }
-
whoops, found it: short_open_tag http://php.net/manual/en/ini.core.php
-
I believe its a certain setting in PHP. I haven't any clue which one though.
-
$loadLast100JokesSQL = 'SELECT * from jokes_en ORDER BY joke_posting_date LIMIT 1,100 DESC'; That should load you're last 100 jokes inside the mysql server plus, I'm sure you need capitals for SELECT, ORDER BY, LIMIT and DESC
-
Use print_r(mysql_fetch_array(mysql_query("SELECT * FROM xhost_boxs")); to show your full array and make sure that doesn't loop either, if it does then it may be the class. I'm not that good with classes, just custom functions
-
http://php.net/manual/en/function.fopen.php http://php.net/manual/en/function.fread.php http://php.net/manual/en/function.preg-match.php