For more of them check the list in the following link :
http://en.wikipedia.org/wiki/List_of_web_analytics_software
Create table PivotTestTable
(CustName varchar(8),
Item_Type varchar(8),
Item_Amount numeric(6,2))
insert into #PivotTestTable- UnPivoted data : When the temp table, #PivotTestTable, is queried, the result is the following.
select 'Jason', 'Computer', 435.34
union
select 'Jason', 'Software', 243.54
union
select 'Jason', 'Monitor', 158.23
union
select 'Alison', 'Computer', 345.89
union
select 'Alison', 'Software', 78.78
union
select 'Alison', 'Monitor', 123.45
CustName Item_Type Item_Amount
-------- --------- -----------
Alison Computer 345.89Alison Monitor 123.45
Alison Software 78.78Jason Computer 435.34
Jason Monitor 158.23Jason Software 243.54
SELECT
CustName as Total_Sales_By_Cust,
sum(case Item_Type when 'Computer' then Item_Amount end) as Computer,
sum(case Item_Type when 'Monitor' then Item_Amount end) as Monitor,
sum(case Item_Type when 'Software' then Item_Amount end) as Software
FROM PivotTestTable
GROUP BY CustName
SELECT
CustName as Total_Sales_By_Cust,
sum(Item_Type = 'Computer') as Computer,
sum(Item_Type = 'Monitor' ) as Monitor,
sum(Item_Type ='Software' ) as Software
FROM PivotTestTable
GROUP BY CustName
c:\program files\visualsvn server\bin\svn.exe" export https://svn.yourserver.com:4433/svn/YourRepository/Websites/YourWebsite/ C:\inetpub\wwwroot\YourWebsite --quiet --non-interactive --force --username youruser --password yourpassword-Click Ok.
sudo pecl install mongo2.Open your php.ini file and add to it:
extension=mongo.soIt is recommended to add this to the section with the other "extensions", but it will work from anywhere within the php.ini file.
sudo apt-get install php5-dev php5-cli php-pearHowever, you can download the source for the driver and can compile it manually :
shell> tar -xzvf mongo-1.2.6.tar.gzCheck with the phpinfo
shell> cd mongo-1.2.6
shell> phpize
shell> ./configure
shell> make
shell> make install
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10genFor example, you can vim the “source.list” and append the 10gen package like this :
$ sudo vim /etc/apt/sources.listFile : /etc/apt/sources.list
#...content omitted ...
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu natty main
deb-src http://extras.ubuntu.com/ubuntu natty main
#mongo repo ##########
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
sudo apt-get updateNow, a new “mongodb-10gen – An object/document-oriented database” is available for install.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
sudo apt-get install mongodb-10gen5. Post-InstallationVerification
# mongodb.conf
# Where to store the data.
# Note: if you run mongodb as a non-root user (recommended) you may
# need to create and set permissions for this directory manually,
# e.g., if the parent directory isn't mutable by the mongodb user.
dbpath=/var/lib/mongodb
#where to log
logpath=/var/log/mongodb/mongodb.log logappend=true
#port = 27017
#......
$ mongoon my next post I will try to connect php with this mongoDB.
MongoDB shell version: 1.8.1 connecting to: test
>
yum install ffmpeg ffmpeg-develIf you get package not found, then you will need to add few lines in the yum repository for dag packages installation. Create a file named dag.repo in /etc/yum.repos.d with the following contents on it
[dag]then
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
yum install ffmpeg ffmpeg-develIf everything is fine, then the installation should proceed smoothly. If not you will get something like warning GPG public key missing .
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpmFor more information refer to this faq depending on Centos version
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package ffmpegthen most commonly you have GLIB 2.3 installed instead of GLIB 2.4 version. To check the current GLIB version installed on your server. just use
Error: Missing Dependency: libtheora.so.0(libtheora.so.1.0) is needed by package ffmpeg
Error: Missing Dependency: rtld(GNU_HASH) is needed by package ffmpeg
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package a52dec
Error: Missing Dependency: rtld(GNU_HASH) is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package gsm
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package x264
Error: Missing Dependency: rtld(GNU_HASH) is needed by package xvidcore
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package lame
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package a52dec
Error: Missing Dependency: rtld(GNU_HASH) is needed by package faad2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package x264
Error: Missing Dependency: rtld(GNU_HASH) is needed by package lame
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package xvidcore
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package faac
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package faad2
Error: Missing Dependency: libgif.so.4 is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package faac
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package gsm
Error: Missing Dependency: libpng12.so.0(PNG12_0) is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package libmp4v2
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package libmp4v2
yum list glib*and it should list the latest GLIB package version.
[rpmforge]To know what linux type and version you are running
name = Red Hat Enterprise $releasever - RPMforge.net - dag
#baseurl = http://apt.sw.be/redhat/el4/en/$basearch/dag
mirrorlist = http://apt.sw.be/redhat/el4/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
cat /etc/redhat-releaseOnce this is done, do again yum install ffmpeg.
ffmpeg// This lists path of mpeg, its modules and other path information
ffmpeg -formats
ffmpeg --help
ffmpeg -i Input.file Output.fileTo check what audi/video formats are supported
ffmpeg -formats > ffmpeg-format.txtOpen the ffmpeg-formats.txt to see the output
wget /path/to/this/file/ffmpeg-php-0.6.0.tbz2
tar -xjf ffmpeg-0.6.0.tbz2
phpizeCommon Errors
./configure
make
make install
yum install ffmpeg-devel3. If you get an error like shared libraries not found problem and the program halts in the middle, then you must specify the ffmpeg installed path explicitly to the ./configure.
configure: error: ffmpeg shared libraries not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared optionTo Fix:
./configure --with-ffmpeg=/usr/local/cpffmpegThat should resolve the problem!
/tmp/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zim_ffmpeg_frame_toGDImage’:
/tmp/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)
/tmp/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported only once
/tmp/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: for each function it appears in.)
/tmp/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zim_ffmpeg_frame_ffmpeg_frame’:
/tmp/ffmpeg-php-0.6.0/ffmpeg_frame.c:421: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)
make: *** [ffmpeg_frame.lo] Erreur 1
vi ffmpeg_frame.c
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32
:w
phpize
./configure
make
make install
vi /etc//php.iniPut the below two lines at the end of the php.ini file
[ffmpeg]Then restart the server service httpd restart. In my case I had a server from godaddy and I had to do the following to restart the webserver :
extension=ffmpeg.so
/usr/sbin/apachectl gracefulTo check whether ffmpeg enabled with php, point your browser to test.php file. It should show the confirmation of installed ffmpeg php extension
// #test.phpThis is what you are suppose to get :
phpinfo()
?>
yum install mplayer mencoderInstalling FlvTool2
wgetIf you get command not found error, it probably means that you dont have ruby installed.
ruby setup.rb config
ruby setup.rb setup
sudo ruby setup.rb install
yum install rubyThats it! Once ffmpeg works fine with php extension, download a sample video, convert to .flv format in the command line and plug it to flowplayer to see it work on your web browser. Try also to download the video file offline and see whether the converted flv file works well with both audio and video.
#!/usr/local/bin/php -q4. Edit this file and make some slight adjustments. First, we don’t want the script to timeout during execution, so somewhere toward the top we add:
set_time_limit(0);5. Set the path to the system folder, if it isn’t correct:
$system_folder = "../system";6. We need to let CI know what controller/method we want to access, and any other URI variables we need. Normally this happens in the URL, so we emulate it by setting PATH_INFO manually:
$_SERVER['PATH_INFO'] = '/mailprocessor/sendmail';
$_GET = ''; // Required for some installationsHowever, if the config uri protocol is set to REQUEST_URI, then CI doesn’t use PATH_INFO, so instead, emulate REQUEST_URI manually:
$_SERVER['REQUEST_URI'] = '/mailprocessor/sendmail';7. You create a mailprocessor.php controller (in the application/controllers dir) with a sendmail method, and make it do what it needs to do, load libraries/models/etc, execute them, then exit. What you don’t want to happen is output anything. Just make sure you don’t echo any content to stdout (echo, loading views, etc.) If you are sending emails, you would load a view file, but return the contents to a variable instead of displaying it (pass true as third param), then run through normal procedures for sending emails.
if($_SERVER['SCRIPT_FILENAME'] != 'mailsender.php')
exit;8.Once everything looks good, add your crontab entry to execute the script, and there you have it! Sample cronjob [from cPanel can easy do that- you just need to put the script location to run]:
# execute cronjob every day at 2am
00 02 * * * /HOME/myusername/misc/scripts/mailsender.phpMy addition :
PHPmotion -This is a free, opensource script and a good startig point if you do not have the money, but would like to experiment to see what kind of traffic your video niche portal can attract. I would not recommend it to anyone who is serious. It works well, but the design templates and the functionality is not that great. But, if you are on a shoestring budget and all you want to do is throw up something quickly and cheap - you can try this. Score: 7/10
Clip-Share - One of the initial players in this space. Has amazing graphical and layout templates that can be purchased in addition to the 4 basic templates that come pre-packaged. This is a solid script and a highly recommended choice for the serious. They sell 2 different versions - a Lite version at $99 and a Pro version at $199. You can purchase additional Web2.0 look-and-feel design template for $100 each. The template files can easily be customized as you wish. I had no problem whatsoever with their support and they were prompt to answer and get back to me with solutions to the problems I faced. If you have the budget go for this one. Recently GodTube.com that uses their script gota funding round of $30 million. Score: 9/10
Rayyz.net - This script is not just for video sharing. It is a complete Social Media website that has has video, photo, music, files, articles, games, blogs and community networking built into the dash board. If you’re looking for a more than just video and a full fledged script of Social Networking around various media - then take a look at this script. Athough, I have not personally tested this script or worked with it - it seems to be alright. the price is a bit steep at $418. If you are serious about setting up a Social Netowrking site around media sharing content, it would be better if you installed Boonex (which has a free version). However, dont strike out Rayzz from your list - as it is quite powerful in its own way (it focuses more on the Social Media sharing tools and aspect than the Social Networking aspect, which is what Boonex does). Score 6.5/10
Attachmax - This script will allow users to download the videos in addition to viewing them streamed. The script comes with a basic database of videos so you can have pre-populated content on your site. While the layout and graphic design may suit some people, I thought the script was pretty average and not too focused. At $$ , this may be a good buy to some of you. Score: 6/10
Alstrasoft Video Share Enterprise - Stay far far away from this one. Its got holes in it and the people behind it have a very bad reputation. I don’t want to bash them too much, but just do a search on Google with their name and you will see what other disgruntled people are saying on various forums. At $300 this is a complete waste of money (even though I would not pay even $10 for it). You have been warned! Score: 0/10
MediaMax Script - This script is a recent re-branding of Video Watch Pro. They have videos, pitcure, audio and social networking too - built into this script. The site and demo looks pretty impressive at $299 and they even have a Google Adsense flash video integration - which will allow you to earn more money within the flahs player. I have read elsewhere that their customer service is not up to mark - but this is not from a confirmed source. I think - you are good to go if you like their look and feel and functionality. Quite impressive. Score: 8/10
VShare - This is the script with the highest value-for-money at $10 !! The features are very advanced and their are plenty of them. I was quite taken by surprise to see the amount of features this script had packed into it - such as, alternate video server uploading, youtube direct embedding etc. The only drawback was the graphical template… it looked a bit ordinary. So, if you have the time and resources to alter template files - then i recommend this script highly. Although there are a few vendors on their site forums who are selling laternate templates, I am yet to see one which is “professional looking”. Also, I’d like to point out that their support and forums are extremely good and I got answers very quickly. Install this script if you have the ability to dabble around with the template and improve its basic look. Score: 9/10
osTube - This script is a media sharing model and offers Video, Photo, Audio, Documents, Community and Blogs. The pre-packaged templates look quite impressive and the functionality and video player look good. I don’t have any idea what it costs - but you should test drive their free version, which has limited features, before you buy their paid versions. They are definitely the most impressive “media sharing” scripts out their from what I can see. May not have as many functions as Rayzz (above), but definitely a better and sleeker dashboard - although I dont know how the engine is under the hood. On what i’ve seen and assuming this script works well, I give them - Score: 8/10
PHPmelody - If you’re looking to setup a Music Videos website, then this is script is fantastic. It does not allow you and your visitors to directly upload videos to the site - but one can embed videos from Youtube - which is a fantastic feature, as not only does it save bandwidth and server resources but it also allows you to quickly add content. They also have a neat “keyword” based search that the admin can use to find videos on Youtube and add them with one click! The script comes pre-packaged with thousands of pre-populated music videos - if you want to get content included right away. A breeze to install, and definitely worth the price at $39 with additional layout templates at $10 to $19. Support is excellent and prompt. Score: 10/10 if you are creating a Music Video website.
VidiScript - This one is a free script and it looked pretty decent (front end) - with ability to show pre-roll ads, insert text banner ads inside video player, a decent flash player, and two not-so-good light and dark templates (that can always be improved by you). VidiScript not only supports Videos, but now also supports Audio, Photo and Flash Game uploads. I dont know how stable this script is and how it will hold up for a busy site, but… hey… its free! and so definitely worth a try. Score: 8/10 (based on what I saw in the front end demo)
Clip-Bucket too. Its free and open sourced. I am not sure how secure it is and how it performs when measured up with the scripts above, as I had a quick look at the front end, but did not install it or use it on a site of my own. I must say for free price, the templates, the player the look and feel are HIGHLY professional and the folks behind it have done a great job in making a very neat user interface and front end. By the looks of it - this is going to be a killer video sharing script … and will probably put behind vhsare and phpmotion - if the backend lives up to the quality of the front end.
Mass video populator: It claims that it will allow you to mass populate and add videos to your video site (all scripts above are supported), in a few clicks. The price, I believe is the only downside as they have gone in for a bulk pricing, which works out to around 10 cents a video - steep I thought, for someone who wants to add say 1000 videos. Its a web based remote service.
VideoWatchPro: It is not that great, and scores around 5/10, from a brief look. I havent seen it in depth - but it doesn’t look to be anything worth spending more time on.
Conclusion: I suggest that you pick and choose from the scripts above and if you are selecting one not listed above you do your homework well - as their are many clones and copies of pre-existing scripts out their with holes in them. Start doing your research on this page of hotscripts.com - that lists a whole bunch of media sharing php scripts, and also make sure you visit forums such as Programming Talk to read reviews posted by other customers.
<?phpReference :
$wsdl_url = "http://urltowebservice.wsdl";
$client = new SoapClient($wsdl_url);
$params = array('pasrm1'=>7, 'param2'=>'EN');
try {
$objectResult = $client->SomeMethod($params);
echo $objectResult->ResponseResult;
} catch (SoapFault $exception) {
echo $exception;
}
//var_dump($client->__getFunctions());
?>
<?phpThe only thing that you should take care of is that NOTHING should be printed before the header() function call.
header("Location: http://www.myurl.abc");
echo "I don know what to do next";
?>
<?phpReference:
ob_start();
//Your html and or other code to print html
echo "A line before header() call";
header("Location: http://www.url");
ob_end_flush();
?>
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteRule ^our-services/strategic-consulting$ /our_services.php?id=1 [L]
RewriteRule ^our-services/web-design$ /our_services.php?id=2 [L]
RewriteRule ^our-services/web-development$ /our_services.php?id=3 [L]
</ifmodule>
The IfModule conditional directive wraps a section of rewrite rules, and ensures that they will only get executed on a server that has mod_rewrite capabilities. If the module did not exist, and there was no conditional directive, users will receive an HTTP Error 500 - Internal Server Error. It is good practice to always use this directive.
According to the documentation, “The RewriteEngine directive enables or disables the runtime rewriting engine.” RewriteEngine can be declared multiple times within .htaccess, which can actually help with debugging. The directive can be turned on or off, and instead of commenting out or deleting a line during testing, it is best to use RewriteEngine Off. In the example there is only the need to turn the rewrite engine on once.
The RewriteRule directive is one of the most powerful aspects of mod_rewrite. I invite you to bookmark and eventually read the official documentation for RewriteRule. There are too many facets to this directive to cover them all, so I will mention just a few.
<FilesMatch "index">
ForceType application/x-httpd-php
</FilesMatch>
// constructs search friendly urls and create correct url paths for links and images
class UrlFilter {
var $origUrl;
var $numOfItems;
var $itemsMap;
function UrlFilter()
{
$this->processURI();
$this->constructBaseUrl();
}
function processURI()
{
$array = explode("index", $_SERVER['PHP_SELF']);
$newUrl = str_replace("/", "", $array[count($array)-1]);
$array = explode("-", $newUrl);
$num = count($array);
$this->numOfItems = $num;
$url_array = array();
$items = explode("-", $newUrl);
$num = count($items);
for ($i = 0 ; $i < $num ; $i++) { $item = explode("_", $items[$i]); $this->itemsMap[$item[0]] = $item[1] ;
}
}
function constructBaseUrl()
{
// need to construct the original url
$array = explode("index", $_SERVER['PHP_SELF']);
$num = count($array);
$this->origUrl = "";
for ($i = 0; $i < $num-1 ; $i++) { $this->origUrl = $this->origUrl . $array[$i];
}
}
function getItem($key)
{
if (array_key_exists($key, $this->itemsMap)) {
return $this->itemsMap[$key];
} else {
return null;
}
}
function getOriginalUrl()
{
return $this->origUrl . "index";
}
function getBaseUrl()
{
return $this->origUrl;
}
}
$url = "http://www.example.com/domains/detailedStatistics";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$curl_scraped_page = curl_exec($ch);
curl_close($ch);
$regex = '~(.*?)
~s';
preg_match($regex,$curl_scraped_page,$match);
//var_dump($match);
echo "Detailed domain statistics:";
echo "". $match[0]."";
?>
//A Beautiful html dom parserThat's it :) Happy curling then :)
include('./simple_html_dom.php');
$cat = explode("?",$_SERVER['REQUEST_URI']);
$url = "http://www.example.com/Domain_Name_Search_Results.aspx?".$cat[1];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$curl_scraped_page = curl_exec($ch);
curl_close($ch);
// find all tabele tags with id=results
$html = str_get_html($curl_scraped_page);
$thetable = $html->find('table[class=BlackLeftRight]',0);
foreach($thetable->find('img') as $img)
{
$img->outertext = "";
}
echo "".$thetable->innertext."
" ;
?>