News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

MOD: Comment Posting By Time

Started by pslawinski, November 21, 2005, 02:58:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pslawinski

I made some modifications to my Upload Activity By Time mod to make it show comment postings by time.


profile.php

Find:

        pagefooter();
        ob_end_flush();
        break;
}


Replace with:
Note: Replace all references to images/siteLayout/Contentpanel_Sidebar_11.gif with your own image

//Comment Posting By Time
starttable(705, "Comment Posting By Time", 1);
$query = "SELECT msg_date as uploadTime FROM {$CONFIG['TABLE_COMMENTS']} as c WHERE c.author_id = '$uid'";
$result = cpg_db_query($query);
$rowset = cpg_db_fetch_rowset($result);
mysql_free_result($result);
$uploadTimes = array();
$total = 0;
foreach($rowset as $row)
{
$split1 = explode(' ', $row[0]);
$split2 = explode(':', $split1[1]);
switch($split2[0])
{
case '00':
$index = 0;
break;
case '01':
$index = 1;
break;
case '02':
$index = 2;
break;
case '03':
$index = 3;
break;
case '04':
$index = 4;
break;
case '05':
$index = 5;
break;
case '06':
$index = 6;
break;
case '07':
$index = 7;
break;
case '08':
$index = 8;
break;
case '09':
$index = 9;
break;
default:
$index = $split2[0];
}
$uploadTimes[$index] = @$uploadTimes[$index] + 1;
$total++;
}

ksort($uploadTimes, SORT_NUMERIC);

print('<tr><td align="center" colspan="26"><b>Time of Day (GMT'.$CONFIG['time_offset'].')</b></td></tr>');
print('<tr><td align="center" colspan="26" height="2"></td></tr>');
print('<tr><td align="center" colspan="26" height="2" bgcolor="#000000"></td></tr>');
print('<tr><td align="center" colspan="26" height="1"></td></tr>');
print('<tr><td height="100" width="1" valign="bottom"><img src="images/siteLayout/Contentpanel_Sidebar_11.gif" width="1" height="200" /></td>');
for($i = '0'; $i <= '23'; $i++)
{
if(isset($uploadTimes[$i]))
{
print('<td height="100" width="4%" valign="bottom" align="center" style="font-size: 80%">'.round($uploadTimes[$i]/$total*'100',0).'%<br /><img src="images/siteLayout/Contentpanel_Sidebar_05.gif" border="1" alt="" width="15" height="'.round($uploadTimes[$i]/$total*'200',0).'" /></td>');
}
else
{
print('<td height="100" width="4%"></td>');
}
}
print('<td height="100" width="1" valign="bottom"><img src="images/siteLayout/Contentpanel_Sidebar_11.gif" width="1" height="200" /></td></tr>');
print('<tr><td align="center" colspan="26" height="1"></td></tr>');
print('<tr><td align="center" colspan="26" height="2" bgcolor="#000000"></td></tr>');
print('<tr><td align="center" colspan="26" height="1"></td></tr>');
print('<tr><td></td>');
for($i = '0'; $i <= '23'; $i++)
{
#if(isset($uploadTimes[$i]))
#{
# print('<td width="15">'.$i.' ('.round($uploadTimes[$i]/$total*'200',0).'%)</td>');
#}
#else
#{
print('<td width="4%" align="center">'.$i.'</td>');
#}
}
print('<td></td></tr>');

endtable();


        pagefooter();
        ob_end_flush();
        break;
}


I've attached a grab from the site: