Videos don't have Uri

Anyone else have this issue?


My videos don't have a uri so boonex defaults to the first video.


Grr, more hacking todo

Quote · 27 Jan 2010

The issue here comes from

/flash/modules/videos/inc/functions.php

Essentially the uploadVideo function DOES NOT set a Uri.

The cron is then suppose to set the Uri.

However even with the cron running it wasnt creating the Uri but was setting videos to approved. To fix this I change uploadVideo to this:

[code]function uploadVideo($sFilePath, $sUserId, $isMoveUploadedFile, $sImageFilePath = '', $sFileName = '')
{
global $sModule;
global $sFilesPath;

$sTempFileName = $sFilesPath . $sUserId . TEMP_FILE_NAME;
@unlink($sTempFileName);

if(file_exists($sFilePath) && filesize($sFilePath) > 0)
{
if(is_uploaded_file($sFilePath)) move_uploaded_file($sFilePath, $sTempFileName);
else {
@rename($sFilePath, $sTempFileName);
}
@chmod($sTempFileName, 0644);
if(file_exists($sTempFileName) && filesize($sTempFileName)>0)
{
if(!grabImages($sTempFileName, $sTempFileName))
return false;

$sImageFilePath = "1";
$sTempImgFileName = $sFilesPath . $sUserId . TEMP_FILE_NAME . IMAGE_EXTENSION;
$sTempThumbFileName = $sFilesPath . $sUserId . TEMP_FILE_NAME . THUMB_FILE_NAME . IMAGE_EXTENSION;

$sDBModule = DB_PREFIX . ucfirst($sModule);
//aaron modified it so we have a uri so we can actually view them! 27/01/2010
//upon insert, the url is suppose to be set, but if the jquery screws up, then it isnt and the cron doesn't recognise its empty! so we default gift it a uri
$sUri = SafeUri($sFilename).'-'.time().'-'.$sUserId;
getResult("INSERT INTO `" . $sDBModule . "Files` SET `Title` = '".$sFileName."', `Uri` ='".$sUri."', `Description`='" . $sFileName . "', `Date`='" . time() . "', `Owner`='" . $sUserId . "', `Status`='" . STATUS_PENDING . "' ");
$sFileId = getLastInsertId();
rename($sTempFileName, $sFilesPath . $sFileId);
if($sImageFilePath != '') {
@rename($sTempImgFileName, $sFilesPath . $sFileId . IMAGE_EXTENSION);
@rename($sTempThumbFileName, $sFilesPath . $sFileId . THUMB_FILE_NAME . IMAGE_EXTENSION);
}
return $sFileId;
}
}
return false;
}

function SafeUri($string) {
$new = array(' ',     '[',     ']',     '%',    ',',    '.',    '£',     '$',    '!',    '&',    '/',    '\\',    '?',    '+',    '(',    ')',    ':',    '"',    '--',    "'", "\x99", "\xA9", "\xAE", "\xA0");
$old = array('-',     '',        '',        '',        '',        '-',    '',        '',     '',        'and',    'or',    'or',    '',        '',        '',        '',        '',    '',    '-',     '', '', '', '', '');
return str_replace($new, $old, $string);
}

[/code]

Quote · 27 Jan 2010

Just to note, this is essentially a backup way of doing things, incase the cron failed for some reason. Which it occasionally did. Or if the user made the title just a space.

Quote · 27 Jan 2010

Just to note, this is essentially a backup way of doing things, incase the cron failed for some reason. Which it occasionally did. Or if the user made the title just a space.

May be you can write function to translate russian letters in URL for all type of uploading media, name of categories, albums, etc.? Because Dolphin doesnt understand russian title at for example uploading video, and replace all russian letters just by "-", and doesntadd ( .html ) at the end of URL.


Please help if you can.

Quote · 27 Jan 2010

Hello everybody!

We already improved some points of video upload - it will be available in 7.0.1. uploadVideo now has uri generate (like in lightfarm fix) but it helps in cases when user didn't press submit after uploading (ticket 1750) - in other parts uri was generating every time.

About non-latin symbols:

yes, by default uri from title with non-latin sysmobols will be converted to '-', then if such uri already exists to '-' with adding current date, then - adding order numbers from 0 to 9, then - random number from 0 to 999.

Regard

Quote · 28 Jan 2010

Hello everybody!

We already improved some points of video upload - it will be available in 7.0.1. uploadVideo now has uri generate (like in lightfarm fix) but it helps in cases when user didn't press submit after uploading (ticket 1750) - in other parts uri was generating every time.

About non-latin symbols:

yes, by default uri from title with non-latin sysmobols will be converted to '-', then if such uri already exists to '-' with adding current date, then - adding order numbers from 0 to 9, then - random number from 0 to 999.

Regard

Please make function that transform ALL listed problems of non-latin symbols in title categories, albums, video, audio ... into simply ID.

It's a solution of any non-latin symbols in URL, see:

- http://www.go2life.net/m/videos/browse/album/ ID of category /owner/Pavel2010 - because russian title of category will be just "-"

or

- http://www.go2life.net/m/videos/view/ ID of video .html - please note that ( .html ) at the end MUST be, this is call Friendly Permalinks!

or

- http://www.go2life.net/m/articles/category/ ID / ... and so on, etc...

Method of ID instead of translit is better and real solution of that old language problems!

Quote · 28 Jan 2010

Hello kab!


Sorry i forgot to tell what need to do for getting non-latin symbols convertation in Uri. Go to inc/utils.inc.php file, find function uriFilter, comment/delete this line:

$s = get_mb_replace ('/([^\d^\w]+)/', '-', $s); // latin characters only

and uncomment this one:

//$s = get_mb_replace ('/[^\pL^\pN]+/u', '-', $s); // unicode characters

In this case this function (all our uri generations work through it) will convert all symbols fine.

Regard

Quote · 28 Jan 2010

Hello kab!


Sorry i forgot to tell what need to do for getting non-latin symbols convertation in Uri. Go to inc/utils.inc.php file, find function uriFilter, comment/delete this line:

$s = get_mb_replace ('/([^\d^\w]+)/', '-', $s); // latin characters only

and uncomment this one:

//$s = get_mb_replace ('/[^\pL^\pN]+/u', '-', $s); // unicode characters

In this case this function (all our uri generations work through it) will convert all symbols fine.

Regard

This method is not enought.

Please make function that transform ALL listed problems of non-latin symbols in title categories, albums, video, audio ... into simply ID.

It's a solution of any non-latin symbols in URL, see:

- http://www.go2life.net/m/videos/browse/album/ ID of category /owner/Pavel2010 - because russian title of category will be just "-"

or

- http://www.go2life.net/m/videos/view/ ID of video .html - please note that ( .html ) at the end MUST be, this is call Friendly Permalinks!

or

- http://www.go2life.net/m/articles/category/ ID / ... and so on, etc...

Method of ID instead of translit is better and real solution of that old language problems!

Quote · 28 Jan 2010

Hello Kab!

In current system it's impossible - need to apply too many changes. Also permalinks with ID haven't big sence, that's why we added "uri evolution" from 6.1 version.

Regards

Quote · 28 Jan 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.