Jump to content

blake87

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

blake87's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Solved it worked how it should, I think I did see this method before, I just didnt follow the examples vvery well ie I was trying to use strtotime ( string $time [, int $now ] ) which didnt work for me, got it working now I just used $Ctime = strtotime ($Ctime); Works a treat thanks ProjectFear
  2. dammn, how did I manage to miss this method, I guess i was looking in the wrong place!, thanks, I think this will help with what im trying to do ill let you know
  3. How can I convert this time date format "2008-09-03 10:59:03" to this type of time date format "01182494270", is it possible, hopefully there’s a method which can achieve this easily, could someone explain the latter format as well if possible thanks in advance
  4. I have already used that function, but not for removing images since I dont want to remove all images just one particular image , thanks for the reply
  5. When I use the str_replace function, I can remove most of the desired strings within the text but when I attempt to remove an image containing specific words, it is not removed can anyone help me with this example $words =array("<img src=\"http://image"); $introtext =str_replace($words,"",$introtext); Thanks in advance I hope theres a simple solution
  6. For the fireboard forum, Id like to have a quick post function which works like vbullitin, so it does not refresh after quick posting, how hard would this to do, any advice welcome I think I could do this with some good instructions Thanks in advance all
  7. I know theres just a few code changes I need for a few plugings to work on my subsites, so any help is welcomed <?php /** * Tab to display medals of the jAwards Component in a CB-Profile * Author: Armin Hornung */ class getAwardsTab extends cbTabHandler { function getAwardsTab() { $this->cbTabHandler(); } function getDisplayTab($tab,$user,$ui) { global $database,$mosConfig_live_site, $mosConfig_absolute_path, $mosConfig_lang; // Language: if (file_exists($mosConfig_absolute_path."/administrator/components/com_jawards/language/".$mosConfig_lang.".php")) include_once($mosConfig_absolute_path."/administrator/components/com_jawards/language/".$mosConfig_lang.".php"); else if(file_exists($mosConfig_absolute_path."/administrator/components/com_jawards/language/english.php")) include_once($mosConfig_absolute_path."/administrator/components/com_jawards/language/english.php"); else return "Error: No language file could be loaded. Is the jAwards component properly installed?"; // Config & jAwards-component-check: if (file_exists($mosConfig_absolute_path."/administrator/components/com_jawards/config.jawards.php")) require_once($mosConfig_absolute_path."/administrator/components/com_jawards/config.jawards.php"); else return "Error: jAwards Config file could not be read. Is the appropriate version of the jAwards-component installed?"; $params = $this->params; $return=""; $query = "SELECT *" . "\n FROM #__jawards_awards AS a" . "\n LEFT JOIN #__jawards_medals AS b ON b.id = a.award" . "\n WHERE a.userid=". $user->id ."" . "\n ORDER BY a.date desc" ; $database->setQuery( $query ); $items = $database->loadObjectList(); if(!count($items)>0) { // $return = _AWARDS_NOAWARD; // return $return; return null; } $return .= "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"95%\">"; $return .= "<tr class=\"sectiontableheader\">"; $return .= "<td colspan=\"2\">"._AWARDS_AWARD."</td><td>"._AWARDS_DATE."</td>"; if ($ja_config['showawardreason']) $return .="<td>"._AWARDS_REASON."</td>"; $return .= "</tr>"; $i=1; foreach($items AS $item) { $i= ($i==1) ? 2 : 1; $return .= "<tr class=\"sectiontableentry$i\"><td>" ."<img src=\"".$mosConfig_live_site."/images/medals/".$item->image."\" alt=\"".$item->image."\" />" ."<td>".$item->name." </td>" ."</td><td> ".date("d. m. Y",strtotime($item->date)) . "</td>"; if ($ja_config['showawardreason']) $return .="<td>$item->reason</td>"; $return.= "</tr>\n"; } $return .= "</table>"; $descUrl = $params->get('awardsDesc',''); $showDesc = $params->get('showAwardsDesc','1'); if ($descUrl =='') $descUrl='index.php?option=com_jawards'; if ($showDesc) $return.="<br /><a href=\"$descUrl\">"._AWARDS_INFORMATION."</a>"; return $return; } } ?> My subsites are located on the same DB if this helps
  8. So yes there is a seperate upload file script, sorry about the previous post I am still at work he he
  9. there are other files within the main componment folder if this helps
  10. Yes it does stil not allow me to upload
  11. I got an error at this line now if ($hata!="")){ Any ideas My mistake I know a bit about programming and it I got two braces when it should be one if ($hata!=""){ instead of if ($hata!="")){
  12. function upload($file,$desc,$catid,$title,$accid){ global $database; $database->setQuery( "SELECT * FROM #__achtube_config"); $database->loadObject($row); if ($database -> getErrorNum()) { echo $database -> stderr(); return false; } global $mosConfig_absolute_path,$mosConfig_live_site,$database,$my; $query = "SELECT d.name as name, d.id as id from #__groups as d"; $database->setQuery($query); $accs = $database->loadObjectList(); $myacc[] = mosHTML::makeOption( -1, "Select Access Level"); foreach($accs as $obj){ $myacc[] = mosHTML::makeOption( $obj->id, $obj->name); } $lists['accs'] = mosHTML::selectList( $myacc, 'accid', 'class="inputbox" size="1" ', 'value', 'text'); $query = "SELECT s.name as name, s.id as id from #__categories as s WHERE s.section = $row->secid AND s.published = 1 AND s.access <= '$usertype' ORDER BY s.ordering"; $database->setQuery($query); $cats = $database->loadObjectList(); $mycat[] = mosHTML::makeOption( -1, "Select Category"); foreach($cats as $obj){ $mycat[] = mosHTML::makeOption( $obj->id, $obj->name); } $lists['cats'] = mosHTML::selectList( $mycat, 'catid', 'class="inputbox" size="1" ', 'value', 'text'); HTML_achtube::upload($option, $rows[0], $lists); if($_POST[submit]!=""){ global $database; $vid = new stdClass; if ($title==""){ $hata = "Please provide a video title"; } if ($desc==""){ $hata = "Please provide video description"; } if ($catid=="-1"){ $hata = "Please select a category"; } if ($file==""){ $hata = "Please select a video file for upload"; } if ($hata!=""){ mosRedirect("index.php?option=com_achtube&task=upload", $hata); } $vhost = $_FILES['file']['name']; $vhos = strrpos($vhost,"."); $vex = strtolower(substr($vhost,$vhos+1,strlen($vhost)-$vhos)); $vsize = round($_FILES['file']['size']/(1024*1024)); if ($vex!="mpg" && $vex!="avi" && $vex!="mpeg" && $vex!="wmv" && $vex!="rm" && $vex!="dat"){ $hata = "Invalid video format"; } if ($space > $row_acht['maxvideo']){ $hata = "Video size is too big. Upload limit is : ".$row_acht['maxvideo']." Mb."; } $vid->title = $title; $vid->fulltext = $desc; $vid->created_by = $my->id; $vid->created_by_alias = $my->name; $vid->catid = $catid; $vid->state = "1"; $vid->sectionid = "1"; $vid->created = date( 'Y-m-d H:i:s' ); $vid->publish_up = date( 'Y-m-d H:i:s' ); $vid->access = $accid; $vid->metakey = $title." , ".$desc; $vid->metadesc = $title." , ".$desc; if (!$database->insertObject( '#__content', $vid, 'id' )) { echo $database->stderr(); return false; } $videono = mysql_insert_id(); $videoname = $videono.".".$vex; if(isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])){ $videonhost = $mosConfig_absolute_path.$row->videodir."/".$videoname; if(move_uploaded_file($_FILES['file']['tmp_name'], $videonhost)){ $flvmaker = $row->ffmpegdir; if($row->htype=="1"){ $flvmaker = $mosConfig_absolute_path.$row->ffmpegdir; } exec ($flvmaker." -i ".$videonhost." -acodec ".$row->acodec." -ab ".$row->abit." -ar ".$row->arate." -b ".$row->vbit." -r ".$row->frate." -s ".$row->flvsize." ".$mosConfig_absolute_path.$row->flvdir."/".$videono.".flv"); exec ($flvmaker." -an -y -t 0:5:0.001 -i ".$mosConfig_absolute_path.$row->flvdir."/".$videono.".flv -f image2 ".$mosConfig_absolute_path.$row->jpgdir."/".$videono.".jpg"); $ssim = $mosConfig_absolute_path.$row->jpgdir."/".$videono.".jpg"; $simg = imagecreatefromjpeg($ssim); $ddim = $mosConfig_absolute_path.$row->tmbdir."/".$videono.".jpg"; $dimg = imagecreatetruecolor($row->tmbl, $row->tmbw); imagecopyresized($dimg, $simg, 0, 0, 0, 0, $row->tmbl, $row->tmbw, $row->flvl, $row->flvw); imagejpeg($dimg, $ddim, $row->imgq); //update global $database; $id = $videono; $vid->ordering = $videono; $vid->introtext = '<p><a href="'.$mosConfig_live_site.'/index.php?option=com_achtube&task=view&id='.$videono.'&Itemid=1&"><img src="'.$mosConfig_live_site.$row->tmbdir.'/'.$videono.'.jpg" border="0" title="'.$title.'" /></a></p><hr />'; $vid->attribs = $vex; $vid->images = "com_achtube/intros/".$videono.".jpg"; if (!$database->updateObject( '#__content', $vid, 'id' )) { echo $database->stderr(); return false; } if ($row->auto_publish == "1"){ global $database; $vidf = new stdClass; $vidf->content_id = $videono; $vidf->ordering = $videono; if (!$database->insertObject( '#__content_frontpage', $vidf, 'id' )) { echo $database->stderr(); return false; } } } } header("Location:index.php"); } hope this helps
  13. http://www.gamezspace.net/index.php?option=com_achtube&Itemid=67 the form is there if this helps
  14. I am not sure, when I submit on the front end, nothing happens
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.