Help With Joomla Script.

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 22, 2009, 09:37 PM
430949 members and 298045 Topics
Latest Member: sahils_way
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Webmasters (Moderators: OmniPotens, yawa-ti-de)  |  Help With Joomla Script.
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Help With Joomla Script.  (Read 206 views)
wrexs
Help With Joomla Script.
« on: September 14, 2009, 06:21 PM »

Hello Brothers, I am working on a site with joomla, i have this script that allows my users to upload and send pictures but i want to edit it so it would upload mp3s instead of pictures.

I will appreciate any good info. Thanks!
inf8nity (m)
Re: Help With Joomla Script.
« #1 on: September 15, 2009, 09:47 AM »

Which script are you using?
wrexs
Re: Help With Joomla Script.
« #2 on: September 15, 2009, 12:06 PM »

Its a java script.
yawa-ti-de (f)
Re: Help With Joomla Script.
« #3 on: September 15, 2009, 01:18 PM »

I dunno if this will work but perhaps you need to look at the code and see where it is setting the recognized file types then, change it from whatever it is now to mp3.  Also make sure that the encoding is set properly.

I have done it for php but not javascript but would imagine the process is the same.  Where to find the javascript within your template? Use your cpanel and browse to the template folder and you should see the javascript folder within it.

If my approach doesn't work, google the web for an mp3 upload javascript and add it to your template.

Good luck!
wrexs
Re: Help With Joomla Script.
« #4 on: September 15, 2009, 02:13 PM »

Thanks bro, I think you should take a look at the code;

<script language="javascript">
function filecheckerrors()
{
    if(document.getElementById("file_title").value==0)
    {
        alert("Please enter the File name");
        document.getElementById("file_title").focus();
        return false;
    }
    if(document.getElementById("file_price").value==0)
    {
        alert("Please enter the File price");
        document.getElementById("file_price").focus();
        return false;
    }
    if(isNaN(document.getElementById("file_price").value))
    {
        alert("File price contains numeric value");
        document.getElementById("file_price").focus();
        return false;
    }
    if(document.getElementById("file_description").value==0)
    {
        alert("Please enter the File description");
        document.getElementById("file_description").focus();
        return false;
    }
    if(document.getElementById("updatefileid").value==0)
    {
        if(document.getElementById("files_thumb").value==0)
        {
            alert("Please enter your thumbnail from browse");
            document.getElementById("files_thumb").focus();
            return false;
        }
        if(document.getElementById("files_image").value==0)
        {
            alert("Please enter your file from browse");
            document.getElementById("files_image").focus();
            return false;
        }
    }
}
function checkPhoto(picField)
{
        var picFile = picField;
        var imagePath = document.getElementById("files_image").value;
        var pathLength = imagePath.length;
        var lastDot = imagePath.lastIndexOf(".");
        var fileType = imagePath.substring(lastDot,pathLength);
        if((fileType == ".docx") || (fileType == ".rar") || (fileType ==
".pdf") || (fileType == ".zip") || (fileType == ".xlsx") || (fileType
== ".PNG"))
        {
          return true;
        }
        else
        {
          if(imagePath!='')
          {
          alert("We supports .rar, .zip, .xlsx, .pdf and .docx file formats.
Your file-type is " + fileType + ".");
          document.getElementById("files_image").value='';
          }
        }

}
function check_images(picField)
{
        var picFile = picField;
        var imagePath = document.getElementById("files_thumb").value;
        var pathLength = imagePath.length;
        var lastDot = imagePath.lastIndexOf(".");
        var fileType = imagePath.substring(lastDot,pathLength);
        if((fileType == ".jpg") || (fileType == ".gif") || (fileType ==
".bmp") || (fileType == ".png") || (fileType == ".jpeg"))
        {
          return true;
        }
        else
        {
          if(imagePath!='')
          {
          alert("We supports .jpg, .gif, .png, .bmp and .jpeg file formats.
Your file-type is " + fileType + ".");
          document.getElementById("files_thumb").value='';
          }
        }

}
function createObject()
{
    var request_type;
    var browser=navigator.appName;
    if(browser=="Microsoft Internet Explorer")
    {
        request_type=new ActiveXObject("Microsoft.XMLHTTP");
    }
    else
    {
        request_type=new XMLHttpRequest();
    }
    return request_type;
}
var http=new createObject();
function productedits(Product_id)
{

    url='components/com_comprofiler/plugin/user/plug_cbstore/files.php?product_id='+Product_id;

    http.open("GET",url);
    http.onreadystatechange=replyedites;
    http.send(null);
}
function replyedites()
{
    var response=http.responseText;
    if(http.readyState==4)
    {
        document.getElementById('lighting').style.display='block';
        document.getElementById('fading').style.display='block';
        document.getElementById("Update_Product").innerHTML=response;
    }
}
function functionpaypal()
{
    document.getElementById('displayoption').style.display='block';
    document.getElementById('hide_paypal').style.display='none';
}
function paypalcancel()
{
    document.getElementById('displayoption').style.display='none';
    document.getElementById('hide_paypal').style.display='block';
}
function confirmationcancel()
{
    if(confirm("Are you sure you want to delete this product?"))
    {
        return true;
    }
    else
    {
        return false;
    }
}

</script>
   

<?php
include("imagesize.php");
global $mosConfig_live_site,$_CB_database;
$my                =&    JFactory::getUser();
$pathforproduct="components/com_filestore/images/";
$Thumbnail="components/com_filestore/images/thumbnail/";
if($_REQUEST['action']=='paypal')
{
      $paypal="insert #__file_paypal set
userid=".$my->id.",product_id=".$_REQUEST['product_id'].",dateadded='".date("Y:m:d")."'";

    $_CB_database->setQuery($paypal);
    $_CB_database->query();
    header("location:index.php?option=com_comprofiler&task=userProfile&user=".$_REQUEST['user']);
}
if(isset($_REQUEST['Submit']))
{     
    global $_CB_database;
    $my                =&    JFactory::getUser();
    if($_FILES['files_image']['name']!='')
    {
        $files1=str_replace($_FILES['files_image']['name'],$my->id.date("Ymds")."_".$_FILES['files_image']['name'],$_FILES['files_image']['name']);
        move_uploaded_file($_FILES['files_image']['tmp_name'],
$pathforproduct.str_replace(" ","_",$files1));
       
    }
    if($_FILES['files_thumb']['name']!='')
    {
        $files2=str_replace($_FILES['files_thumb']['name'],$my->id.date("Ymds")."_".$_FILES['files_thumb']['name'],$_FILES['files_thumb']['name']);
        move_uploaded_file($_FILES['files_thumb']['tmp_name'],
$Thumbnail.str_replace(" ","_",$files2));
        $img = new Simples_Image();
        $img->load($Thumbnail.str_replace(" ","_",$files2));
        $img->resize(100,100);
        $img->save($Thumbnail.str_replace(" ","_",$files2));
    }
    $insert="insert #__file_product set
file_title='".$_REQUEST['file_title']."',file_description='".$_REQUEST['file_description']."',files_image='".str_replace("
","_",$files1)."',files_thumb='".str_replace("
","_",$files2)."',file_price=".$_REQUEST['file_price'].",userid=".$my->id."";
    $_CB_database->setQuery($insert);
    $_CB_database->query();
  header("location:index.php?option=com_comprofiler&task=userProfile&user=".$my->id);
}
if(isset($_REQUEST['Update']) && $_REQUEST['FileID'])
{
    global $_CB_database;
    $SQL="select * from #__file_product where product_id=".$_REQUEST['FileID'];
    $_CB_database->setQuery($SQL);
    $rsImages=$_CB_database->loadObjectList();
    if($_FILES['files_image']['name']!='')
    {
        if(file_exists($pathforproduct.$rsImages[0]->files_image))
        {
            unlink($pathforproduct.$rsImages[0]->files_image);
        }
        $files1=str_replace($_FILES['files_image']['name'],$my->id.date("Ymds")."_".$_FILES['files_image']['name'],$_FILES['files_image']['name']);
        move_uploaded_file($_FILES['files_image']['tmp_name'],
$pathforproduct.str_replace(" ","_",$files1));
        $image_update=",files_image='".str_replace(" ","_",$files1)."'";
    }
    if($_FILES['files_thumb']['name']!='')
    {
        if(file_exists($Thumbnail.$rsImages[0]->files_thumb))
        {
            unlink($Thumbnail.$rsImages[0]->files_thumb);
        }
        $files2=str_replace($_FILES['files_thumb']['name'],$my->id.date("Ymds")."_".$_FILES['files_thumb']['name'],$_FILES['files_thumb']['name']);
        move_uploaded_file($_FILES['files_thumb']['tmp_name'],
$Thumbnail.str_replace(" ","_",$files2));
        $img = new Simples_Image();
        $img->load($Thumbnail.str_replace(" ","_",$files2));
        $img->resize(100,100);
        $img->save($Thumbnail.str_replace(" ","_",$files2));
        $product_thumbs=",files_thumb='".str_replace(" ","_",$files2)."'";
    }
    $update="update #__file_product set
file_title='".$_REQUEST['file_title']."',file_description='".$_REQUEST['file_description']."',file_price=".$_REQUEST['file_price']."
".$image_update." ".$product_thumbs." where
product_id=".$_REQUEST['FileID'];

    $_CB_database->setQuery($update);
    $_CB_database->query();
    header("location:index.php?option=com_comprofiler&task=userProfile&user=".$my->id);
}
if($_REQUEST['action']=='delete')
{
    $select="select * from #__file_product where
product_id=".$_REQUEST['product_id'];
    $_CB_database->setQuery($select);
    $rsDelete=$_CB_database->loadObjectList();
    if(file_exists($Thumbnail.$rsDelete[0]->files_thumb))
    {
        unlink($Thumbnail.$rsDelete[0]->files_thumb);
    }
    if(file_exists($pathforproduct.$rsDelete[0]->files_image))
    {
        unlink($pathforproduct.$rsDelete[0]->files_image);
    }
    $delete="delete from #__file_product where
product_id=".$_REQUEST['product_id'];
    $_CB_database->setQuery($delete);
    $_CB_database->query();
    header("location:index.php?option=com_comprofiler&task=userProfile&user=".$my->id);
}
if(isset($_REQUEST['paypal_submit']))
{
    global $_CB_database;
    $update="update #__comprofiler set
paypal_email='".$_REQUEST['paypal_email']."' where id=".$my->id;
    $_CB_database->setQuery($update);
    $_CB_database->query();
}

?>
<style>
                .blackverlay
                {
                  display: none;
                  position: absolute;
                  top: 0%;

                  left: 0%;
                  width: 100% ;
                  height: 100% ;
                  z-index:1001;
                  -moz-opacity: 0.8;
                  opacity:.80;
                  filter: alpha(opacity=80);
              }
              .content_whites
              {
                  display: none;
                  position: fixed;

                  top: 10% ;

                  left: 10% ;

                  width: 700px !important;

  *width: 100%;

                  height: 390px !important;

*height: 100%;

                  padding: 16px;

                  border: 30px solid #CCCCCC;

                  background-color: white;
                  z-index:1002;
                  overflow: auto;
              }     
   
          </style>
<div id="lighting" class="content_whites">
<form name="paypalForms"
action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business"  id="paypal_business"
value="kaushi_1220438306_biz@raincreatives.com">
<input type="hidden" name="item_name" id="FilesName_title" value="Image">
<input type="hidden" name="amount" id="amount" value="">
<input type="hidden" name="return" id="returnvar" value="<?php echo
$mosConfig_live_site;?>/index.php?option=com_comprofiler&user=<?php
echo $my->id;?>">
<input type="hidden" name="notify_url"
value="http://www.mybusiness.com/ipn.cgi">
</form>
<form action="" method="post" enctype="multipart/form-data">
<div id="Update_Product" >
<table width="100%" border="0">
  <tr>
    <td colspan="2" align="center"
style="font-family:Arial;font-size:25px;color:#000000;font-weight:bold;"
height="40" id="Title_for_file">Add File</td>
  </tr>
  <tr>
    <td  height="35" width="270"  valign="top"><b>File Name :</b></td>
    <td><input name="file_title" id="file_title" type="text" size="40" /></td>
  </tr>
  <tr>
      <td><b>File Price :</b></td>
    <td><input type="text" value="" name="file_price" id="file_price"
size="40" /></td>
  </tr>
  <tr>
    <td  height="35" valign="top"><b>File description :</b></td>
    <td><textarea name="file_description" id="file_description"
cols="50" rows="7">&nbsp;</textarea></td>
  </tr>
    <tr>
    <td  height="35"  valign="top"><b>Thumbnail :</b></td>
    <td><input name="files_thumb" id="files_thumb"  onblur="return
check_images(this.name);"  type="file" size="30" /></td>
  </tr>
  <tr>
    <td  height="35"  valign="top"><b>File :</b></td>
    <td><input name="files_image" id="files_image"  onBlur="return
checkPhoto(this.name);"  type="file" size="30" /></td>
  </tr>
  <tr>
      <td colspan="2"  height="35" align="center"><input type="submit"
onblur=""  id="sub_value" onclick="return filecheckerrors();"
name="Submit" value="Submit" /></td>
    </tr>
</table>
<input type="hidden" name="FileID" id="updatefileid" value="0">
</div>
</form>
<br />
<span  style="padding-left:230px;"> <a href = "javascript:void(0)"
onclick = "document.getElementById('lighting').style.display='none';document.getElementById('fading').style.display='none'">Close</a></span></div>
<div id="fading" class="blackverlay"></div>
<script language="javascript">
function paypalgotothe(price,product_id,status,file_title)
{

    if(document.getElementById("PaypalUser").value=='users')   
    {   
        new_paypal_users=document.getElementById("EmailPaypal").value;
    }
    else if(document.getElementById("PaypalUser").value=='admin')
    {
        new_paypal_users=document.getElementById("EmailPaypal").value;
    }
    else if(document.getElementById("PaypalUser").value=='none')
    {
        if(status==1)
        {
            new_paypal_users=document.getElementById("EmailPaypal").value;
        }
        else
        {
            new_paypal_users=document.getElementById("PaypalAdmin").value;
        }
    }
   
    document.getElementById("FilesName_title").value=file_title;
   
    document.getElementById("paypal_business").value=new_paypal_users;
    document.getElementById("amount").value=price;
    document.getElementById("returnvar").value="<?php echo
$mosConfig_live_site;?>/index.php?option=com_comprofiler&user=<?php
echo $_REQUEST['user'];?>&action=paypal&product_id="+product_id;
    document.paypalForms.submit();
}
   
function isfilesopened()
{
    document.getElementById('lighting').style.display='block';
    document.getElementById('fading').style.display='block';
    document.getElementById("file_title").value='';
    document.getElementById("file_price").value='';
    document.getElementById("file_description").value='';
    document.getElementById("sub_value").value='Submit';
    document.getElementById("sub_value").name='Submit';
    document.getElementById("Title_for_file").innerHTML='Add File';
}
function onpaypalsubmit()
{
    if(document.getElementById("PaypalID").value==0)
    {
        alert("Please enter the value of paypal id");
        document.getElementById("PaypalID").focus();
        return false;
    }
    if(!isValidEmail(document.getElementById("PaypalID").value))
    {
        alert("Please enter the proper value of paypal id");
        document.getElementById("PaypalID").focus();
        return false;
    }
}
function isValidEmail(str)
{
  return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

</script><?php
/**
* Joomla Community Builder User Plugin: plug_cbhelloworld
* @version $Id$
* @package plug_helloworld
* @subpackage helloworld.php
* @author Nant, JoomlaJoe and Beat
* @copyright (C) Nant, JoomlaJoe and Beat, www.joomlapolis.com
* @license Limited  http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @final 1.0
*/

/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not
allowed.' );/**
* Basic tab extender. Any plugin that needs to display a tab in the
user profile
* needs to have such a class. Also, currently, even plugins that do
not display tabs (e.g., auto-welcome plugin)
* need to have such a class if they are to access plugin parameters
(see $this->params statement).
*/
class getstoreTab extends cbTabHandler {
    /**
    * Construnctor
    */
    function getstoreTab() {
        $this->cbTabHandler();
    }
   
    /**
    * Generates the HTML to display the user profile tab
    * @param object tab reflecting the tab database entry
    * @param object mosUser reflecting the user being displayed
    * @param int 1 for front-end, 2 for back-end
    * @returns mixed : either string HTML for tab content, or false if
ErrorMSG generated
    */
    function getDisplayTab($tab,$user,$ui)
    {
            global $_CB_database;
            $my                =&    JFactory::getUser();
            $select="select paypal_email from #__comprofiler";
            $_CB_database->setQuery($select);
            $totCount=$_CB_database->loadObjectList();
            if(count($totCount)==0)
            {
                $ifexists=" ALTER TABLE `jos_comprofiler` ADD `paypal_email`
VARCHAR( 300 ) NULL AFTER `acceptedterms`";
                $_CB_database->setQuery($ifexists);
                $_CB_database->query();
            }
            $pathforproduct="components/com_filestore/icons/";
            $return .= "<div>";
            $SQL="select * from #__file_product where userid=".$user->id;
            $_CB_database->setQuery($SQL);
            $rsProduct=$_CB_database->loadObjectList();
            $paypal="select * from #__file_paypal_config where status=1";
            $_CB_database->setQuery($paypal);
            $rsPaypal=$_CB_database->loadObjectList();
            $admin="select C.paypal_email  from #__users AS U JOIN
#__comprofiler as C On C.id=U.id where U.usertype='Super
Administrator'";
            $_CB_database->setQuery($admin);
            $rsAdmin=$_CB_database->loadObjectList();
            $return.="<table width='100%' align='center'>";
            if($user->id==$my->id)
            {
                $return.="<tr><td colspan='3'></td><td><a
href='javascript:void(0)' onclick='return isfilesopened();'
><b>Add</b></a></td></tr>";
            }
            if($user->id==$my->id)
            {
            $return.='<tr><td colspan="3"></td><td><span
style="cursor:pointer;" onclick="return functionpaypal();"
id="hide_paypal">Paypal Id</span></td></tr>';
            }
            $return.='<tr><td colspan="4"><form action="" method="post"><table
id="displayoption" style="display:none;" width="100%"
align="center">';
            $return.='<tr><td><h3>Enter Paypal Id</h3></td></tr>';
            $return.='<tr><td><input type="text" class="inputbox" id="PaypalID"
name="paypal_email"  size="40"
value="'.$user->paypal_email.'"></td></tr>';
            $return.='<tr><td><input type="submit"  onclick="return
onpaypalsubmit();" name="paypal_submit" class="button"
value="Submit">&nbsp;&nbsp;<input type="button" value="Cancel"
onclick="return paypalcancel();"  class="button"></td></tr>';
            $return.='</table></form>';
            if($rsPaypal[0]->username=='admin')
            {
                $return.='<input type="hidden"
value="'.$rsAdmin[0]->paypal_email.'" id="EmailPaypal">';
                //$return.='<input type="hidden"
value="'.$rsAdmin[0]->paypal_email.'" id="AdminPaypal">';
            }
            else if($rsPaypal[0]->username=='users')
            {
                $return.='<input type="hidden" value="'.$user->paypal_email.'"
id="EmailPaypal">';
            //    $return.='<input type="hidden"
value="'.$rsAdmin[0]->paypal_email.'" id="AdminPaypal">';
            }
            else
            {
                $return.='<input type="hidden"
value="'.$rsAdmin[0]->paypal_email.'" id="PaypalAdmin">';
                $return.='<input type="hidden" value="'.$user->paypal_email.'"
id="EmailPaypal">';
            }
            $return.='<input type="hidden" id="PaypalUser"
value="'.$rsPaypal[0]->username.'" >';
            $Thumbnail="components/com_filestore/images/thumbnail/";
            for($i=0;$i<count($rsProduct);$i+=4)
            {
                $return.="<tr><td>";
                if($rsProduct[$i]->file_title!='')
                {
                    $first_image= explode(".",$rsProduct[$i]->files_image);
                   
               
                    $return.="<img  title='".$rsProduct[$i]->file_description."'
src='".$Thumbnail.$rsProduct[$i]->files_thumb."'
class='thumbnail'><br><b>".$rsProduct[$i]->file_title."</b><br><b>Price
:</b>".$rsProduct[$i]->file_price."$<br>";
                    if( $my->id==$user->id)
                    {
                        $return.="<a href='javascript:void(0)'  onclick='return
productedits(".$rsProduct[$i]->product_id.");'>Edit</a> || <a
onclick='return confirmationcancel();'
href='index.php?option=com_comprofiler&user=".$user->id."&product_id=".$rsProduct[$i]->product_id."&action=delete'>Delete</a><br>";
                    }
                    $image_download="select * from #__file_paypal where
userid=".$my->id." and product_id=".$rsProduct[$i]->product_id;
                    $_CB_database->setQuery($image_download);
                    $rsDownload1=$_CB_database->loadObjectList();
                    if(count($rsDownload1)!=0 || $my->id==$user->id)
                    {
                    $return.="<a
href='components/com_comprofiler/plugin/user/plug_cbstore/download.php?filename=".$rsProduct[$i]->files_image."'
target='_blank'>Download</a><br>";
                    }
                    if( $my->id!=$user->id)
                    {
                        $return.='<input type="button" value="Buy Now" class="button"
onclick="return
paypalgotothe(\''.$rsProduct[$i]->file_price.'\',\''.$rsProduct[$i]->product_id.'\',\''.$rsProduct[$i]->status.'\',\''.$rsProduct[$i]->file_title.'\')">';
                    //    $return.='<input type="button"
value="'.$rsProduct[$i]->file_price.'" class="button"
onclick="alert(\''.$rsProduct[$i]->file_price.'\') "> ';
                    }
                }
                $return.="</td>";
                $return.="<td>";
                if($rsProduct[$i+1]->file_title!='')
                {
                    $second_image= explode(".",$rsProduct[$i+1]->files_image);
                    $return.="<img  title='".$rsProduct[$i+1]->file_description."'
src='".$Thumbnail.$rsProduct[$i+1]->files_thumb."'
class='thumbnail'><br><b>".$rsProduct[$i+1]->file_title."</a></b><br><b>Price
:</b>".$rsProduct[$i+1]->file_price."$<br>";
                  if( $my->id==$user->id)
                    {
                        $return.="<a href='javascript:void(0)'  onclick='return
productedits(".$rsProduct[$i+1]->product_id.");'>Edit</a> || <a
onclick='return confirmationcancel();'
href='index.php?option=com_comprofiler&user=".$user->id."&product_id=".$rsProduct[$i+1]->product_id."&action=delete'>Delete</a><br>";
                    }
                    $image_download1="select * from #__file_paypal where
userid=".$my->id." and product_id=".$rsProduct[$i+1]->product_id;
                    $_CB_database->setQuery($image_download1);
                    $rsDownload1=$_CB_database->loadObjectList();
                    if(count($rsDownload1)!=0  || $my->id==$user->id)
                    {
                        $return.="<a
href='components/com_comprofiler/plugin/user/plug_cbstore/download.php?filename=".$rsProduct[$i+1]->files_image."'
target='_blank'>Download</a><br>";
                    }
                    if( $my->id!=$user->id)
                    {
                        //$return.="<input type='button' onclick='return
paypalgotothe(".$rsProduct[$i+1]->file_price.",".$rsProduct[$i+1]->product_id.",".$rsProduct[$i+1]->status.")'
value='Buy Now' class='button'>";
                        $return.='<input type="button" value="Buy Now" class="button"
onclick="return
paypalgotothe(\''.$rsProduct[$i+1]->file_price.'\',\''.$rsProduct[$i+1]->product_id.'\',\''.$rsProduct[$i+1]->status.'\',\''.$rsProduct[$i+1]->file_title.'\')">';
                   
                    }
                }
                $return.="</td>";
                $return.="<td>";
                if($rsProduct[$i+2]->file_title!='')
                {
                    $third_image= explode(".",$rsProduct[$i+2]->files_image);
                    $return.="<img  title='".$rsProduct[$i+2]->file_description."'
src='".$Thumbnail.$rsProduct[$i+2]->files_thumb."'
class='thumbnail'><br><b>".$rsProduct[$i+2]->file_title."</b><br><b>Price
:</b>".$rsProduct[$i+2]->file_price."$<br>";
                    if( $my->id==$user->id)
                    {
                        $return.="<a href='javascript:void(0)'  onclick='return
productedits(".$rsProduct[$i+2]->product_id.");'>Edit</a> || <a
onclick='return confirmationcancel();'
href='index.php?option=com_comprofiler&user=".$user->id."&product_id=".$rsProduct[$i+2]->product_id."&action=delete'>Delete</a><br>";
                    }
                    $image_download2="select * from #__file_paypal where
userid=".$my->id." and product_id=".$rsProduct[$i+2]->product_id;
                    $_CB_database->setQuery($image_download2);
                    $rsDownload2=$_CB_database->loadObjectList();
                    if(count($rsDownload2)!=0  || $my->id==$user->id)
                    {
                    $return.="<a
href='components/com_comprofiler/plugin/user/plug_cbstore/download.php?filename=".$rsProduct[$i+2]->files_image."'
target='_blank'>Download</a><br>";
                    }
                    if( $my->id!=$user->id)
                    {
                        $return.='<input type="button" value="Buy Now" class="button"
onclick="return
paypalgotothe(\''.$rsProduct[$i+2]->file_price.'\',\''.$rsProduct[$i+2]->product_id.'\',\''.$rsProduct[$i+2]->status.'\',\''.$rsProduct[$i+2]->file_title.'\')">';
                        //$return.="<input type='button' value='Buy Now' onclick='return
paypalgotothe(".$rsProduct[$i+2]->file_price.",".$rsProduct[$i+2]->product_id.",".$rsProduct[$i+2]->status.")'
class='button'>";
                    }
                }
                $return.="</td>";
                $return.="<td>";
                if($rsProduct[$i+3]->file_title!='')
                {
                    $fourth_image= explode(".",$rsProduct[$i+3]->files_image);
                    $return.="<img  title='".$rsProduct[$i+3]->file_description."'
src='".$Thumbnail.$rsProduct[$i+3]->files_thumb."'
class='thumbnail'><br><b>".$rsProduct[$i+3]->file_title."</b><br><b>Price
:</b>".$rsProduct[$i+3]->file_price."$<br>";
                    if( $my->id==$user->id)
                    {
                        $return.="<a href='javascript:void(0)'  onclick='return
productedits(".$rsProduct[$i+3]->product_id.");'>Edit</a> || <a
onclick='return confirmationcancel();'
href='index.php?option=com_comprofiler&user=".$user->id."&product_id=".$rsProduct[$i+3]->product_id."&action=delete'>Delete</a><br>";
                    }
                    $image_download3="select * from #__file_paypal where
userid=".$my->id." and product_id=".$rsProduct[$i+3]->product_id;
                    $_CB_database->setQuery($image_download3);
                    $rsDownload3=$_CB_database->loadObjectList();
                    if(count($rsDownload3)!=0  || $my->id==$user->id)
                    {
                        $return.="<a
href='components/com_comprofiler/plugin/user/plug_cbstore/download.php?filename=".$rsProduct[$i+3]->files_image."'
target='_blank'>Download</a><br>";
                    }
                    if( $my->id!=$user->id)
                    {
$return.='<input type="button" value="Buy Now" class="button"
onclick="return
paypalgotothe(\''.$rsProduct[$i+3]->file_price.'\',\''.$rsProduct[$i+3]->product_id.'\',\''.$rsProduct[$i+3]->status.'\',\''.$rsProduct[$i+3]->file_title.'\')">';
                        //$return.="<input type='button' value='Buy Now' onclick='return
paypalgotothe(".$rsProduct[$i+3]->file_price.",".$rsProduct[$i+3]->product_id.",".$rsProduct[$i+3]->status.")'
class='button'>";
                    }
                }
                $return.="</td></tr>";
            }
            $return.="</table>";
           
        //    $return.='<a href="javascript:void(0)" onclick="return
isproduct();" >Add</a><br>';
            $return .= "</div>";
            return $return;
    } // end or getDisplayTab function
} // end of gethelloworldTab class
?>
inf8nity (m)
Re: Help With Joomla Script.
« #5 on: September 15, 2009, 02:28 PM »

Javascript is quite tricky from experience the extension validation code is in a totally different script. Sometimes just changing the extension names doesn't make the script work either.
So u better look for another script that allows .mp3 or if you good at javascript go through the files and edit them to suit you.
yawa-ti-de (f)
Re: Help With Joomla Script.
« #6 on: September 15, 2009, 02:52 PM »

poster:
Your code (which was both PHP and JS by the way, not just JS) came up as spam.  I suggest that you paste your code within the "code" tags and maybe it won't be flagged again.

Based on what I am seeing, I think if you tack on another OR statement to the file types like so: (|| fileType == "mp3") as a start, you can then see if that works and if it doesn't have a baseline from where to continue.

good luck!

Quote
Javascript is quite tricky from experience the extension validation code is in a totally different script. Sometimes just changing the extension names doesn't make the script work either.
So u better look for another script that allows .mp3 or if you good at javascript go through the files and edit them to suit you.

inf8nity:
The poster I believe, says that he "has this script" so I don't see where the bolded portion of your quote above makes sense with respect to this post.  Or have you seen the script in question? or r you posing as the same person but with 2 different IDs?  Tongue
inf8nity (m)
Re: Help With Joomla Script.
« #7 on: September 15, 2009, 06:52 PM »

Quote
Javascript is quite tricky from experience the extension validation code is in a totally different script.

Now that's what i call proper moderation. My bad Typo. Nways i meant the validation code is in a totally different file Grin
*dhtml
Re: Help With Joomla Script.
« #8 on: September 15, 2009, 09:55 PM »

My tongues are tied. . .javascript + joomla = if you are not a regular coder, i advise to just look for an extension that will solve your problem.
The problem (speaking of the first post) is trivial enough for regular coders that understand the script, maybe you should zip and send the script to me
so i can help sort it out
lojik (m)
Re: Help With Joomla Script.
« #9 on: September 19, 2009, 07:52 AM »

Quote from: wrexs on September 14, 2009, 06:21 PM
Hello Brothers, I am working on a site with joomla, i have this script that allows my users to upload and send pictures but i want to edit it so it would upload mp3s instead of pictures.

I will appreciate any good info. Thanks!


1. If u are using joomla, is the "script" in question part of a joomla module, component or a modification of the default joomla uploader?
2. If not, is it coded by you or downloaded as JS and used in your joomla project?

If u can paste the script here and clarify how it is integrated with joomla, U could get help faster.
yawa-ti-de (f)
Re: Help With Joomla Script.
« #10 on: September 19, 2009, 12:05 PM »

I have sent an email to seun to unblock the post with the code.  Stay tuned.
*dhtml
Re: Help With Joomla Script.
« #11 on: September 20, 2009, 07:51 AM »

mehn, dis codes are too much for me to read o!
yawa-ti-de (f)
Re: Help With Joomla Script.
« #12 on: September 20, 2009, 12:11 PM »

dhtml,

As they say, b careful wat u ask for  Tongue
*dhtml
Re: Help With Joomla Script.
« #13 on: September 20, 2009, 01:02 PM »

The problem with these codes are plenty:
1- it is in procedural, if it were written in jquery, it will be much lighter and easier to sort out
2-if it was procedural and i am told the area havin problems, i can sort it out much easily
but for me to step by step logical debuggin for these amount of codes - for free - doubtful!
yawa-ti-de (f)
Re: Help With Joomla Script.
« #14 on: September 20, 2009, 01:23 PM »

dhtml:
I don't think the poster even knows where to start which is why he is posting his code.  What I would do is "comb" through the code as best you can and check for possible typos, and other errors that might help weed out possibilities.

As I mentioned earlier, one way might be to add an "|| (fileType == ".mp3")" to function getPhoto.  Unfortunately, the poster hasn't gotten back to us on this which leads me to believe he actually didn't need the help and we are wasting our time (which is why I haven't bothered to post further)  Undecided Undecided Huh Undecided Undecided
*dhtml
Re: Help With Joomla Script.
« #15 on: September 20, 2009, 02:49 PM »

Possibly, the poster is looking for an easy way out. . . .for us to just solve everything like that. . . .
wrexs
Re: Help With Joomla Script.
« #16 on: September 22, 2009, 04:01 AM »

Hello Guys, I apologise for not returning with any feed back. 1. My posting rights was disabled, 2. I went out of town for some stuffs.

@yawa, thanks for getting the codes back on the page.

I have just begin combing the codes one, and what I am actually doing is replace all the image/file extension (i.e., like .pdf, .jpg, e.tc) with media extension (eg. .mp3, .m4a, e.t.c) The codes are quite long and applies to 3 other pages so am taking it slow and easy. I hope to get it fixed by tomorrow.

I will update you guys when am done.

Thanks for all your suggestions!
dgreatrock (m)
Re: Help With Joomla Script.
« #17 on: September 24, 2009, 10:51 AM »

i also loaded a joomla stuff on my site but it is showin everythin about joomla! how do i customise it?
*dhtml
Re: Help With Joomla Script.
« #18 on: September 28, 2009, 02:59 PM »

i will see if i can help. but when codes are too much in a single post, i usually run-away
lojik (m)
Re: Help With Joomla Script.
« #19 on: October 01, 2009, 08:02 AM »

These codes are way too much man. Who has d time to read all the code? do u need this much to upload MP3?

No wonder seun blocked it in the first place.
yawa-ti-de (f)
Re: Help With Joomla Script.
« #20 on: October 02, 2009, 03:38 PM »

Coming to think of it, one quick way to fish out errors is to pepper the code with alert statements like, "i am here (u specify the location)".  This has helped my butt a lot, even in recent times.

good luck!
*dhtml
Re: Help With Joomla Script.
« #21 on: October 04, 2009, 10:36 PM »

soooo, i was not the only one havin problems with the loooong codes?
 Virgin Airways Website Don Try  Webmasters Of Africa Marks A Major Milestone  Interview With Simon Gooffin Ceo Esyndicat  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.