<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PugsX Mods</title>
	<atom:link href="http://pugsx.co.uk/mods/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://pugsx.co.uk/mods</link>
	<description>Mods for PhpMotion script</description>
	<lastBuildDate>Sat, 15 May 2010 10:17:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Restrict users viewing</title>
		<link>http://pugsx.co.uk/mods/?p=49</link>
		<comments>http://pugsx.co.uk/mods/?p=49#comments</comments>
		<pubDate>Tue, 11 May 2010 17:02:54 +0000</pubDate>
		<dc:creator>pugsx</dc:creator>
				<category><![CDATA[Phpmotion V3.5]]></category>

		<guid isPermaLink="false">http://pugsx.co.uk/mods/?p=49</guid>
		<description><![CDATA[Here is a mod to allow you to set which of your users can view certain videos 1st add the following fields to your database(make backup 1st) member_profile Name - restricted_allowed type - int length - 1 default - 0 videos Name - restricted type - int length - 1 default - 0 now open [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a mod to allow you to set which of your users can view certain videos</p>
<p>1st add the following fields to your database(make backup 1st)<br />
member_profile</p>
<pre lang="php" line=n>
Name - restricted_allowed
type - int
length - 1
default - 0</pre>
<p>videos</p>
<pre lang="php" line=n>
Name - restricted
type - int
length - 1
default - 0</pre>
<p>now open up play.php<br />
below</p>
<blockquote><p>include_once(&#8216;classes/permissions.php&#8217;);</p></blockquote>
<p>add</p>
<pre lang="php" line=n>
// restrict code
$r_vid = (int) mysql_real_escape_string($_GET['vid']);
$sql = "SELECT * FROM videos WHERE indexer = $r_vid AND approved ='yes'";
$query = @mysql_query($sql);
$result = @mysql_fetch_array($query);
$restricted = $result['restricted'];
echo "Hey - " . $restricted . "";
if ($restricted == 1){
$r_user_id = $_SESSION['user_id'];
$sql = "SELECT * FROM member_profile WHERE user_id = $r_user_id";
$query = @mysql_query($sql);
$result = @mysql_fetch_array($query);
$restricted_allowed = $result['restricted _allowed'];
echo "Hey - " . $restricted_allowed. "";
echo "Hey - " . $r_user_id. "";
if ($restricted_allowed ==1) {
$proceed = true;
}else{
$proceed = false;
	$error_height = '430px;';
	$message_2 = 'Sorry Not today - You are not allowed to view this clip' ;

	$codes = $codes_internal;
	$error_code = errorcodes($codes);

	// tmp test
	if ( $error_height ==  '' ) {
		if (!empty($error_code)) {
			$blk_notification = $error_code['error_display'];
    			$message_type = $error_code['error_type'];
    			$error_message = $error_code['error_message'];
		}
	}

	$template 		= "themes/$user_theme/templates/main_1.htm";
	$inner_template1 	= "themes/$user_theme/templates/inner_notification.htm";

	$TBS 			= new clsTinyButStrong;
	$TBS->NoErr 	= true;
	$TBS->LoadTemplate("$template");

	$TBS->Render 	= TBS_OUTPUT;
	$TBS->Show();

	@mysql_close();
	die();
}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://pugsx.co.uk/mods/?feed=rss2&amp;p=49</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Requests welcome</title>
		<link>http://pugsx.co.uk/mods/?p=46</link>
		<comments>http://pugsx.co.uk/mods/?p=46#comments</comments>
		<pubDate>Fri, 07 May 2010 14:48:10 +0000</pubDate>
		<dc:creator>pugsx</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://pugsx.co.uk/mods/?p=46</guid>
		<description><![CDATA[Hello, I know its been awhile since I&#8217;ve posted anything but had a lot to do changed shifts/roles at work, have a 6 month old little boy, a new house which requires a bit of tlc and a new side project with a mate (links at top of page). So if theres anything phpmotion related [...]]]></description>
			<content:encoded><![CDATA[<p>Hello,<br />
I know its been awhile since I&#8217;ve posted anything but had a lot to do changed shifts/roles at work, have a 6 month old little boy, a new house which requires a bit of tlc and a new side project with a mate (links at top of page).</p>
<p>So if theres anything phpmotion related that I can help with post a reply and I&#8217;ll let you know if I can help.</p>
]]></content:encoded>
			<wfw:commentRss>http://pugsx.co.uk/mods/?feed=rss2&amp;p=46</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Profile Pics to members admin page</title>
		<link>http://pugsx.co.uk/mods/?p=34</link>
		<comments>http://pugsx.co.uk/mods/?p=34#comments</comments>
		<pubDate>Sun, 01 Mar 2009 10:36:36 +0000</pubDate>
		<dc:creator>pugsx</dc:creator>
				<category><![CDATA[Site Admin]]></category>

		<guid isPermaLink="false">http://pugsx.com/mods/?p=34</guid>
		<description><![CDATA[Backup and open manage.php find $result_featured = array(); $query = @mysql_query($result_sql); while ($result1 = @mysql_fetch_array($query)) { //get comments inforation $user_id = mysql_real_escape_string($result1['user_id']); add this straight after ###pics#### $member_id = $result1['user_id']; $sql11 = "SELECT * FROM pictures WHERE user_id = $member_id AND approved ='yes'"; $result11 = @mysql_query($sql11); if (@mysql_num_rows($result11) == 0) { // show place holder [...]]]></description>
			<content:encoded><![CDATA[<p>Backup and open manage.php<br />
find</p>
<pre lang="php" line=n>
    $result_featured = array();
    $query = @mysql_query($result_sql);
    while ($result1 = @mysql_fetch_array($query)) {
       //get comments inforation
        $user_id = mysql_real_escape_string($result1['user_id']);
</pre>
<p>add this straight after</p>
<pre lang="php" line=n>
		###pics####
        $member_id = $result1['user_id'];
        $sql11 = "SELECT * FROM pictures WHERE user_id = $member_id AND approved ='yes'";
        $result11 = @mysql_query($sql11);
        if (@mysql_num_rows($result11) == 0) {
            // show place holder for no image uploaded by user at all
            $picture = $config['site_base_url'] . '/image_s/placeholder.png';
            $picture_array = array('picture' => $picture);
        }
        else {
            $results12 = mysql_fetch_array($result11);
            $result11_existing_file = $results12['file_name'];
            $result11_approved = $results12['approved'];
            // show current picture
            $picture = $config['site_base_url'] . '/pictures/' . $result11_existing_file;
            $picture_array = array('picture' => $picture);
        }
		#####
</pre>
<p>then find this</p>
<pre lang="php" line=n>
$result2 = @array_merge($result1,$video_array);
</pre>
<p>change it to this</p>
<pre lang="php" line=n>
$result2 = @array_merge($result1,$video_array,$picture_array);
</pre>
<p>then in your inner_management.htm file use this code to add the picture<br />
<code><img src="[blk1.picture;block=tr]" width="50" height="50"></code></p>
]]></content:encoded>
			<wfw:commentRss>http://pugsx.co.uk/mods/?feed=rss2&amp;p=34</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Last login and member since mod</title>
		<link>http://pugsx.co.uk/mods/?p=23</link>
		<comments>http://pugsx.co.uk/mods/?p=23#comments</comments>
		<pubDate>Sun, 22 Feb 2009 11:38:08 +0000</pubDate>
		<dc:creator>pugsx</dc:creator>
				<category><![CDATA[Members Profile]]></category>

		<guid isPermaLink="false">http://pugsx.com/mods/?p=23</guid>
		<description><![CDATA[This mod will add these 2 stats to your members profile add the following sql code to your members_profile table ALTER TABLE `member_profile` ADD `lastlog` VARCHAR( 255 ) NOT NULL Backup and open memberprofile.php find $current_city = wordwrap($result["current_city"],15," ",true); on the next line add $lastlog = $result["lastlog"]; $date_created = $result["date_created"]; Save and close memberprofile.php Backup [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>This mod will add these 2 stats to your members profile</p></blockquote>
<p>add the following sql code to your members_profile table</p>
<pre lang="sql" line=n>
ALTER TABLE `member_profile` ADD `lastlog` VARCHAR( 255 ) NOT NULL
</pre>
<p>Backup and open memberprofile.php</p>
<p>find</p>
<pre lang="php" line=n>
$current_city = wordwrap($result["current_city"],15," ",true);
</pre>
<p>on the next line add</p>
<pre lang="php" line=n>
$lastlog = $result["lastlog"];
$date_created = $result["date_created"];
</pre>
<p>Save and close memberprofile.php</p>
<p>Backup and open login.php</p>
<p>find</p>
<pre lang="php" line=n>
//success login - checkinng if user has confirmed email
</pre>
<p>add this before that</p>
<pre lang="php" line=n>
$lastlog = date('j, n, Y');
$sql = "UPDATE member_profile SET lastlog = '$lastlog' WHERE user_name = '$user_name_login'";
@mysql_query($sql);
</pre>
<p>Save and close login.php</p>
<p>Backup and open inner_members_profile.htm</p>
<p>Use these 2 variables to add them where you want them</p>
<pre lang="php" line=n>
[var.lastlog]
[var.date_created]
</pre>
<p>Then save inner_members_profile.htm</p>
<p>Congratulations its complete.</p>
]]></content:encoded>
			<wfw:commentRss>http://pugsx.co.uk/mods/?feed=rss2&amp;p=23</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>General Stats Mod</title>
		<link>http://pugsx.co.uk/mods/?p=7</link>
		<comments>http://pugsx.co.uk/mods/?p=7#comments</comments>
		<pubDate>Sat, 21 Feb 2009 11:22:29 +0000</pubDate>
		<dc:creator>pugsx</dc:creator>
				<category><![CDATA[Main Page]]></category>

		<guid isPermaLink="false">http://pugsx.com/mods/?p=7</guid>
		<description><![CDATA[Enter this sql into your database(sql button in phpmyadmin) (backup first) ?View Code SQLALTER TABLE `messages` ADD `message_status` VARCHAR&#40; 20 &#41; NOT NULL ; ALTER TABLE `member_profile` ADD `video_viewed` INT&#40; 10 &#41; NOT NULL DEFAULT '0'; ALTER TABLE `member_profile` ADD `uploaded` INT&#40; 10 &#41; NOT NULL DEFAULT '0'; Make these changes to your files (backup [...]]]></description>
			<content:encoded><![CDATA[<p>Enter this sql into your database(sql button in phpmyadmin) (backup first)</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code14'); return false;">View Code</a> SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p714"><td class="code" id="p7code14"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`messages`</span> <span style="color: #993333; font-weight: bold;">ADD</span> <span style="color: #ff0000;">`message_status`</span> VARCHAR<span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">20</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> ;
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`member_profile`</span> <span style="color: #993333; font-weight: bold;">ADD</span> <span style="color: #ff0000;">`video_viewed`</span> INT<span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">10</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #ff0000;">'0'</span>;
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`member_profile`</span> <span style="color: #993333; font-weight: bold;">ADD</span> <span style="color: #ff0000;">`uploaded`</span> INT<span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">10</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #ff0000;">'0'</span>;</pre></td></tr></table></div>

<p>Make these changes to your files (backup first)<br />
Open inner_index_2.htm and add this code somewhere where you would like to display the stats</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code15'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p715"><td class="code" id="p7code15"><pre class="html" style="font-family:monospace;">&lt;table id=&quot;table38&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; width=&quot;100%&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width=&quot;17&quot;&gt;&lt;/td&gt;
&lt;td class=&quot;table_border_l_b_r&quot;&gt;
&lt;table id=&quot;about&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; width=&quot;100%&quot; bgcolor=&quot;#e4eff8&quot;&gt;
&lt;p align=&quot;center&quot;&gt;&lt;/p&gt;
&lt;h3&gt;Welcome Back&lt;/h3&gt;
&lt;h4&gt;Welcome back &lt;!--[var.user_name;ope=max:15;comm]--&gt;&lt;/h4&gt;
New Messages : &lt;a href=&quot;http://www.yourdomain.com/emailinbox.php&quot;&gt;&lt;!--[var.msg_num;ope=max:15;comm] --&gt;&lt;/a&gt;
New Friend Requests : &lt;a href=&quot;http://www.yourdomain.com/inviteread.php&quot;&gt;&lt;!--[var.mate_req;ope=max:15;comm] --&gt;&lt;/a&gt;
Videos I've Watched : &lt;!--[var.myvids;ope=max:15;comm] --&gt;
Videos I've uploaded : &lt;a href=&quot;http://www.pugsx.co.uk/myvideos.php&quot;&gt;&lt;!--[var.nummyvids;ope=max:15;comm] --&gt;&lt;/a&gt;
&lt;h4&gt;Some site stats&lt;/h4&gt;
Total Members : &lt;!--[var.members;ope=max:15;comm] --&gt;
New Members Today: &lt;!--[var.todaymem;ope=max:15;comm] --&gt;
New Members Yesterday : &lt;!--[var.yesdaymem;ope=max:15;comm] --&gt;
Total Videos : &lt;!--[var.tvids;ope=max:15;comm] --&gt;
Latest Member : &lt;a href=&quot;http://www.yourdomain.com/memberprofile.php?uid=&amp;lt;!--[var.late_uid;ope=max:15;comm] --&amp;gt;&quot;&gt;&lt;!--[var.late_mem;ope=max:15;comm] --&gt;&lt;/a&gt;
Watched Videos : &lt;!--[var.watvid;ope=max:15;comm] --&gt;
Online Visitors : (&lt;script src=&quot;http://fastonlineusers.com/online.php?d=www.yourdomain.com&quot;&gt;&lt;/script&gt;)&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</pre></td></tr></table></div>

<p>open index.php and add this towards the top of the file</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code16'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p716"><td class="code" id="p7code16"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Msg count</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM messages WHERE to_id = <span style="color: #006699; font-weight: bold;">$user_id</span> AND message_status = 'unread'&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$msg_num</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//friends requests</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM friends WHERE invitation_status = 'pending' AND friends_id = <span style="color: #006699; font-weight: bold;">$user_id</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mate_req</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//total members</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM member_profile&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$members</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Total vids</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM videos WHERE approved='yes'&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$tvids</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//vids ive watched</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;select video_viewed from member_profile where user_id = <span style="color: #006699; font-weight: bold;">$user_id</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_fetch_row"><span style="color: #990000;">mysql_fetch_row</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$myvids</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//watched vids</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT sum(number_of_views) from videos&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$watvid</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_result"><span style="color: #990000;">mysql_result</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span> <span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//my vids</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM videos WHERE user_id = <span style="color: #006699; font-weight: bold;">$user_id</span> AND approved='yes'&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$nummyvids</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//new members today</span>
<span style="color: #000088;">$today</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;date_format&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM member_profile where date_created LIKE '%<span style="color: #006699; font-weight: bold;">$today</span>%'&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$todaymem</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//yesterday members new</span>
<span style="color: #000088;">$Yesterday</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;d-m-y&quot;</span><span style="color: #339933;">,</span><a href="http://www.php.net/mktime"><span style="color: #990000;">mktime</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;m&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">,</span><a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;d&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM member_profile where date_created LIKE '%<span style="color: #006699; font-weight: bold;">$Yesterday</span>%'&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$yesdaymem</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//new videos today</span>
<span style="color: #000088;">$today</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;date_format&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM videos where date_uploaded LIKE '%<span style="color: #006699; font-weight: bold;">$today</span>%'&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$todayvids</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//latest mem</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;select user_name, user_id from member_profile order by user_id desc&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_fetch_row"><span style="color: #990000;">mysql_fetch_row</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$late_mem</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$late_uid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Most viewed video</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT title, MAX(`number_of_views`), indexer FROM `videos` GROUP BY number_of_views DESC LIMIT 1&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_fetch_row"><span style="color: #990000;">mysql_fetch_row</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mvtitle</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$numv</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mvind</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Most uploaded</span>
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT user_id, user_name, MAX(`uploaded`) FROM `member_profile` GROUP BY uploaded DESC LIMIT 1&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_fetch_row"><span style="color: #990000;">mysql_fetch_row</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$usrid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$uname</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$uup</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>open emailread.php and find the following</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code17'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p717"><td class="code" id="p7code17"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">///////////////////////////////////////////</span>
<span style="color: #666666; font-style: italic;">//show message</span>
<span style="color: #666666; font-style: italic;">///////////////////////////////////////////</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM messages WHERE to_id =<span style="color: #006699; font-weight: bold;">$user_id</span> AND indexer = <span style="color: #006699; font-weight: bold;">$indexer</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_fetch_array"><span style="color: #990000;">mysql_fetch_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/wordwrap"><span style="color: #990000;">wordwrap</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/wordwrap"><span style="color: #990000;">wordwrap</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'subject'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email_id</span><span style="color: #339933;">=</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'indexer'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And change it to</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code18'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p718"><td class="code" id="p7code18"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">///////////////////////////////////////////</span>
<span style="color: #666666; font-style: italic;">//show message</span>
<span style="color: #666666; font-style: italic;">///////////////////////////////////////////</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM messages WHERE to_id =<span style="color: #006699; font-weight: bold;">$user_id</span> AND indexer = <span style="color: #006699; font-weight: bold;">$indexer</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_fetch_array"><span style="color: #990000;">mysql_fetch_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/wordwrap"><span style="color: #990000;">wordwrap</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/wordwrap"><span style="color: #990000;">wordwrap</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'subject'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email_id</span><span style="color: #339933;">=</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'indexer'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UPDATE messages SET message_status = 'read' WHERE to_id =<span style="color: #006699; font-weight: bold;">$user_id</span> AND indexer = <span style="color: #006699; font-weight: bold;">$indexer</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And open and edit emailcompose.php and find</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code19'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p719"><td class="code" id="p7code19"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">////////////////</span>
<span style="color: #666666; font-style: italic;">//record message</span>
<span style="color: #666666; font-style: italic;">////////////////</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT into messages (from_username, subject, message, todays_date, to_id) VALUES ('<span style="color: #006699; font-weight: bold;">$user_name</span>', '<span style="color: #006699; font-weight: bold;">$subject</span>', '<span style="color: #006699; font-weight: bold;">$message</span>', '<span style="color: #006699; font-weight: bold;">$todays_date</span>', <span style="color: #006699; font-weight: bold;">$to_id</span>)&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span> or <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;system_error.php?code=101&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And change to</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code20'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p720"><td class="code" id="p7code20"><pre class="php" style="font-family:monospace;"> <span style="color: #666666; font-style: italic;">////////////////</span>
<span style="color: #666666; font-style: italic;">//record message</span>
<span style="color: #666666; font-style: italic;">////////////////</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT into messages (from_username, subject, message, todays_date, to_id, message_status) VALUES ('<span style="color: #006699; font-weight: bold;">$user_name</span>', '<span style="color: #006699; font-weight: bold;">$subject</span>', '<span style="color: #006699; font-weight: bold;">$message</span>', '<span style="color: #006699; font-weight: bold;">$todays_date</span>', <span style="color: #006699; font-weight: bold;">$to_id</span>, 'unread')&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span> or <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;system_error.php?code=101&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Open play.php<br />
add</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code21'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p721"><td class="code" id="p7code21"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UPDATE member_profile SET video_viewed=(video_viewed + 1) WHERE user_id = <span style="color: #006699; font-weight: bold;">$user_id</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>after</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code22'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p722"><td class="code" id="p7code22"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UPDATE videos SET number_of_views = <span style="color: #006699; font-weight: bold;">$views_counter</span> WHERE indexer = <span style="color: #006699; font-weight: bold;">$vid</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Open uploader_finished.php and add</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code23'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p723"><td class="code" id="p7code23"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$sql2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UPDATE member_profile SET uploaded=(uploaded + 1) WHERE user_id = <span style="color: #006699; font-weight: bold;">$user_id</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>After</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code24'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p724"><td class="code" id="p7code24"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO videos
(video_id, GID, title, description, tags, channel, date_uploaded, location_recorded, video_length, allow_comments, allow_embedding, rating_number_votes,
rating_total_points, updated_rating, public_private, approved, number_of_views, user_id) VALUES ('<span style="color: #006699; font-weight: bold;">$uploaded_file_name</span>', '<span style="color: #006699; font-weight: bold;">$GID</span>', '<span style="color: #006699; font-weight: bold;">$title</span>', '<span style="color: #006699; font-weight: bold;">$description</span>', '<span style="color: #006699; font-weight: bold;">$tags</span>',
'<span style="color: #006699; font-weight: bold;">$channel</span>', '<span style="color: #006699; font-weight: bold;">$date_uploaded</span>', '<span style="color: #006699; font-weight: bold;">$location_recorded</span>', '0h 0mins', '<span style="color: #006699; font-weight: bold;">$allow_comments</span>', '<span style="color: #006699; font-weight: bold;">$allow_embedding</span>', 0, 0, 0, '<span style="color: #006699; font-weight: bold;">$public_private</span>', 'pending_conversion', 0, <span style="color: #006699; font-weight: bold;">$user_id</span>)&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Open myvideos.php and add</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code25'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p725"><td class="code" id="p7code25"><pre class="php" style="font-family:monospace;"> <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UPDATE member_profile SET uploaded=(uploaded - 1) WHERE user_id = <span style="color: #006699; font-weight: bold;">$user_id</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>After</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p7code26'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p726"><td class="code" id="p7code26"><pre class="php" style="font-family:monospace;"> <span style="color: #666666; font-style: italic;">//delete from videocomments</span>
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;DELETE FROM videocomments WHERE video_id = <span style="color: #006699; font-weight: bold;">$video_id</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://pugsx.co.uk/mods/?feed=rss2&amp;p=7</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
