Web CMS Designs: Forums
 

 
Post new topic Reply to topic
Message
Display posts from previous:       
PostPosted: Thu Jul 26, 2012 3:06 pm
Reply with quote Back to top
spasticdonkey
Newbie
Newbie
Joined: Nov 18, 2010
Posts: 106
Location: Texas

View user's profile Send private message Visit poster's website
Any issues or questions regarding the Highchart Statistics for RavenNuke module

Story: http://web-cms-designs.com/cms-15-highchart-statistics-for-ravennuke.html
Demo: http://web-cms-designs.com/stats.html
Download (reg required) http://web-cms-designs.com/download-file-6.html

Quote For those not familiar with jHighcharts, it is a charting library written in pure JavaScript, offering an easy way of adding interactive charts to your web site or web application. jHighcharts currently supports line, spline, area, areaspline, column, bar, pie and scatter chart types.

For the purposes of integration within the Statistics module, it uses pie and areaspline charts to compare your traffic over time. Yearly stats are displayed in a pie chart, monthly stats compares up to the last four years by month, and so on.


Image
spasticdonkeywebcmsdesigns
 
PostPosted: Mon Aug 06, 2012 2:34 am
Reply with quote Back to top
nextgen
Newbie
Newbie
Joined: Aug 05, 2012
Posts: 49
Location: Maryland

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Very nice friend.
nextgenwith Kindness comes many rewards.
 
PostPosted: Sun Aug 12, 2012 10:30 am
Reply with quote Back to top
bestbuildpc
Newbie
Newbie
Joined: Jul 11, 2012
Posts: 2

View user's profile Send private message
Beautiful buddy, nice module installed succefully
 
PostPosted: Thu Aug 23, 2012 2:51 am
Reply with quote Back to top
nextgen
Newbie
Newbie
Joined: Aug 05, 2012
Posts: 49
Location: Maryland

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Trying to do the survey mod right now. notepad ++ is my friend for comparing so i can see what needs to be added.

I do believe spastic was mentioned on the walls of a pyramid.. Smile
nextgenwith Kindness comes many rewards.
 
PostPosted: Thu Aug 23, 2012 3:49 am
Reply with quote Back to top
spasticdonkey
Newbie
Newbie
Joined: Nov 18, 2010
Posts: 106
Location: Texas

View user's profile Send private message Visit poster's website
Cool. Just a heads up, it was a little difficult to fit a pie chart in a side block; if you get into trying to do the survey block. It would also require a wide side block as used on this site.

While not producution ready code this should help get you started if you are interested.

Note that there are hard coded references to my disqus acct and the block also assumes shortlinks are enabled. As I said, not production ready Razz

I just created a new block "Survey Results"... Also note that I'm using slideit.js with that block which adds the toggle voting option with cookie awareness; and that there is a variety of CSS declarations required as well. You have to use Firebug for those Smile

php Code:
if ( !defined('BLOCK_FILE') ) {

Header('Location: ../index.php');
die();
}

global $prefix, $multilingual, $currentlang, $db, $boxTitle, $content, $pollcomm, $nukeurl, $headJS;
list($pollID) = $db->sql_fetchrow($db->sql_query('SELECT pollID FROM '.$prefix.'_poll_desc ORDER BY pollID DESC LIMIT 1'));
$pollID = intval($pollID);
if ($pollID == 0 || empty($pollID)) {
$content = '';
} else {
$content = '';
addJSToBody('includes/highcharts/highcharts.js', 'file');
$ThemeSel = get_theme();
$HighChartTheme = 'includes/highcharts/themes/' . $ThemeSel . '.js';
if (file_exists($HighChartTheme)) {
addJSToBody($HighChartTheme, 'file');
}
// check to see if jquery.cookie.js is loaded in the head, if not load it in the body
if (is_array($headJS) and (!in_array(array('file', 'includes/jquery/jquery.cookie.js'), $headJS))) addJSToBody('includes/jquery/jquery.cookie.js', 'file');
addJSToBody('includes/jquery/slideit.js', 'file');
$ds = 'webcmsdesigns';
include_once('includes/jquery/disqus.php');
disqusCounter($ds);
$content .= '<div id="bcontainer"></div>';
$content .= '<div style="clear:both;font-size:1px;height:1px">&nbsp;</div>';
if (!isset($url)) {
$url = 'survey-'.$pollID.'.html';
}
$content .= '<div style="text-align:center;padding:2px;margin:0 auto;"><a href="'.$nukeurl.'/survey-results-'.$pollID.'.html#disqus_thread">Comments</a> | <span id="survey-resultz-button" title="Expand/Collapse Voting Booth"><span id="survey-resultz-wrapper"></span></span></div><div id="survey-resultz" style="clear:both;">';
$content .= '<form action="modules.php?name=Surveys" method="post">';
$content .= '<input type="hidden" name="pollID" value="'.$pollID.'" />';
$content .= '<input type="hidden" name="forwarder" value="'.$url.'" />';
list($pollTitle, $voters) = $db->sql_fetchrow($db->sql_query('SELECT pollTitle, voters FROM '.$prefix.'_poll_desc WHERE pollID=\''.$pollID.'\''));
$pollTitle = check_html($pollTitle, 'nohtml');
$voters = intval($voters);
$boxTitle = _SURVEY;
$content .= '<div class="content" style="text-align:center;padding:10px 0;margin:1px;"><strong>'.$pollTitle.'</strong></div>
';
$content .= '<ul class="surveyor">
';
for($i = 1; $i <= 12; $i++) {
$sql = 'SELECT pollID, optionText, optionCount, voteID FROM '.$prefix.'_poll_data WHERE pollID=\''.$pollID.'\' AND voteID=\''.$i.'\'';
$query = $db->sql_query($sql);
list($pollID, $optionText, $optionCount, $voteID) = $db->sql_fetchrow($query);
$pollID = intval($pollID);
$voteID = intval($voteID);
$optionCount = intval($optionCount);
if (!empty($optionText)) {
$content .= '<li><input type="radio" name="voteID" value="'.$i.'" /><label class="radiovalue">'.$optionText.'</label></li>
';
}
}
$content .= '</ul>';
$content .= '<div style="clear:both;font-size:1px;height:1px">&nbsp;</div>';
$content .= '<br /><center><span class="content"><input type="submit" value="'._VOTE.'" /></span><br /></center></form>';
$content .= '</div>';
$content .= '<noscript><b>'.$pollTitle.'</b><br />';
$sum = 0;
$firstRun = TRUE;
$xAxis = '';
for ($i = 0;$i < 12;$i++) {
$result2 = $db->sql_query('SELECT optionCount FROM ' . $prefix . '_poll_data WHERE pollID=\'' . $pollID . '\' AND voteID=\'' . $i . '\'');
$row2 = $db->sql_fetchrow($result2);
$optionCount = $row2['optionCount'];
$sum = (int)$sum+$optionCount;
}
/* select next vote option */
$result3 = $db->sql_query('SELECT optionText, optionCount FROM ' . $prefix . '_poll_data WHERE pollID=\'' . $pollID . '\' AND optionText !=\'\' ORDER BY optionCount DESC');
while (list($optionText, $optionCount) = $db->sql_fetchrow($result3)) {
$optionCount = intval($optionCount);
if (!empty($optionText)) {
if ($sum) {
$percent = 100*$optionCount/$sum;
} else {
$percent = 0;
}
$percentInt = (int)$percent*4*1;
$percent2 = (int)$percent;

$content .= $optionText.': '.$percent2;
$content .= '<br />';
//spas
if($percent>0){
if($xAxis!='') $xAxis .= ',';
if ($firstRun){
$firstRun = FALSE;
$xAxis .= '
{
name: "'.$optionText.'",
y: '.$percent2.',
sliced: true,
selected: true
}';
}else{
$xAxis .= '
["'.html_entity_decode($optionText).'", '.$percent2.']';
}
}
}
}
$content .= '</noscript>';
$inlineJS = '<script type="text/javascript">
var chart;
$(document).ready(function() {
//<![CDATA[
chart = new Highcharts.Chart({
chart: {
renderTo: "bcontainer",
type: "pie",
//width: 290,
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
style: {
font: "18px \"BlackJackRegular\", Verdana, sans-serif"
},
text: "'.html_entity_decode($pollTitle).'"
},
subtitle: {
style: {
font: "10px \"JunctionRegular\", Verdana, sans-serif"
},
text: "Current Poll Results ~ Total Votes: '.intval($sum).'"
},
tooltip: {
formatter: function() {
return this.point.name +": "+ this.y +" %";
}
},
credits: {
enabled: false
},

legend: {
borderWidth: 0,
navigation: {
activeColor: "#3E576F",
animation: true,
arrowSize: 12,
inactiveColor: "#CCC",
style: {
fontWeight: "bold",
color: "#333",
fontSize: "12px"
}
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: "pointer",
dataLabels: {
distance: -40,
borderRadius: 3,
backgroundColor: "rgba(252, 255, 197, 0.2)",
borderWidth: 1,
shadow: true,
borderColor: "#7E7F71",
color: "#252525",
formatter: function() {
if(this.percentage >= 5){
return " "+ this.point.name +" "+ this.y +"% ";
}
}
},
showInLegend: true,
center: ["50%", "52%"],
size: 250
}
},
series: [{
type: "pie",
name: "'.html_entity_decode($pollTitle).'",
data: [
' . $xAxis . '
]
}]
});
//]]>
});
</script>'."\n";
addJSToBody($inlineJS,'inline');
}
spasticdonkeywebcmsdesigns
 
PostPosted: Thu Aug 23, 2012 4:24 am
Reply with quote Back to top
nextgen
Newbie
Newbie
Joined: Aug 05, 2012
Posts: 49
Location: Maryland

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
thank you, i will have a blast. Like a new puzzle for me. Enjoy your vacation friend.
nextgenwith Kindness comes many rewards.
 
PostPosted: Fri Feb 08, 2013 2:08 am
Reply with quote Back to top
Guardian
Newbie
Newbie
Joined: Sep 22, 2012
Posts: 23

View user's profile Send private message
Recently dropped this into my website, well done!
Looks amazing!
GuardianScript Shack
 
PostPosted: Sat Feb 09, 2013 4:55 am
Reply with quote Back to top
spasticdonkey
Newbie
Newbie
Joined: Nov 18, 2010
Posts: 106
Location: Texas

View user's profile Send private message Visit poster's website
Cool, and thanks! Had hoped at some point to integrate another option using Google Chart Tools or Flot, for sites that cannot use Highcharts for whatever reason.. but not enough time in the day with the other projects going on. Maybe someday...

https://developers.google.com/chart/
http://www.flotcharts.org/

Any thoughts on future admin widgets and a charting library? While we could actually redistribute Highcharts (easiest to use imo) it would require a switch to turn on so we could display their non-commercial license agreement...
spasticdonkeywebcmsdesigns
 
PostPosted: Mon Feb 11, 2013 4:53 am
Reply with quote Back to top
bestbuildpc
Newbie
Newbie
Joined: Jul 11, 2012
Posts: 2

View user's profile Send private message
Hi Spasticdonkey

I've been testing your module today and I found out some validation warning on your copyright

http://web-cms-designs.com/modules/Statistics/copyright.php

In order to solve this

Open modules/Statistics/copyright.php

Search for

Code:
if (!empty($module_version)) { echo ' version </span> '.$module_version.'<br />'; }


Replace with

Code:
if (!empty($module_version)) { echo '<span class="thick">version </span> '.$module_version.'<br />'; }


I wonder if you can guide me why I can not show the disqus addon when I use your survey block. You can take a look at bestbuildpc.org and I guess it is too widy.

Shocked

I guess I do not have your mod.


Last edited by bestbuildpc on Mon Feb 11, 2013 9:34 am; edited 1 time in total 
PostPosted: Mon Feb 11, 2013 9:11 am
Reply with quote Back to top
Guardian
Newbie
Newbie
Joined: Sep 22, 2012
Posts: 23

View user's profile Send private message
I quite like HighCharts but the license might restrict us from using it. Might be a bit mean to provide some really cool charting functionality only to have some users not be able to use it.
I'll have to take a look at those others when I can get some time.
With regard to widgets, I'm hoping we can create them as a one-file = one-widget type affair, similar to 'blocks' so we can just load the file (widget) where it is needed, whether we drive it from a tab or drop-down etc.
Realistically though, I think we'll probably need two types of widget, one type driven purely by a single file (much like a 'block') and the other would probably need a whole directory of files (similar to a module) to contain all the files needed by the widget - I'm thinking of things like core module 'update' alerts or social network feeds.
Not sure if we should just have a directory for each widget even if the widget is only one file just to be consistent and make things easier if we use something like a DIR read to load them.
GuardianScript Shack
 
PostPosted: Sat Jan 11, 2014 9:29 am
Reply with quote Back to top
ruwo
Newbie
Newbie
Joined: Jan 10, 2014
Posts: 7
Location: Heerlen - Netherlands

View user's profile Send private message Visit poster's website
Beautiful module, and installed successfully
1 question i live in the Netherlands, and over here we use the 24 time format is there a way to change the am and pm time to the 24 time?
Thanks for the Module love it!!
 
PostPosted: Sat Jan 11, 2014 2:40 pm
Reply with quote Back to top
Guardian
Newbie
Newbie
Joined: Sep 22, 2012
Posts: 23

View user's profile Send private message
Where do you see that?
On my website I only see the 24 hour time format http://www.script-shack.com/community/modules.php?name=Statistics

I did take a quick look at the modules index.php file but didn't find anything that seemed to be reforming the hours pulled from the database.
GuardianScript Shack
 
PostPosted: Sat Jan 11, 2014 9:20 pm
Reply with quote Back to top
ruwo
Newbie
Newbie
Joined: Jan 10, 2014
Posts: 7
Location: Heerlen - Netherlands

View user's profile Send private message Visit poster's website
It is only in the module Highchart Statistics for RavenNuke and not in the std one.
If you go on top of this page to demo then you see hourly stats and there is the am pm time it is set in the index.php file of this module.

Code:
            // HighCharts Chart (begin)

            if($xAxis!='') $xAxis .= ', ';
            if ($k >= 13) {
               $ampm = 'pm';
               $dahour = $k-12;
            } else {
               $ampm = 'am';
               if ($k == 0){
                  $dahour = 12;
                  } else {
                  $dahour = $k;
               }
            }
            $xAxis .= '"' . $dahour . $ampm . '"';
            if($yAxis!='') $yAxis .= ', ';
            
            if ($k != $nowtime) {
               $yAxis .= $hits;
            } else {
               // special marker if hour is current hour
               if (($nowdate==$date) AND ($nowyear==$year)){
               $yAxis .= '{
                     y: '.$hits.',
                     marker: {
                        symbol: "circle",
                        radius: 4,
                        fillColor: "#104242",
                        lineWidth: 2,
                        lineColor: "#237e6f"
                     }
                  }';
               } else {
                  $yAxis .= $hits;
               }
            }
            // HighCharts Chart (end)
         echo '<img src="themes/' . $ThemeSel . '/images/leftbar.gif" alt="" width="' . $l_size[0] . '" height="' . $l_size[1] . '" /><img src="themes/' . $ThemeSel . '/images/mainbar.gif" height="' . $m_size[1] . '" width="' . $WidthIMG * 2 . '" alt="" /><img src="themes/' . $ThemeSel . '/images/rightbar.gif" alt="" width="' . $r_size[0] . '" height="' . $r_size[1] . '" /> ' . $d_percent . '% (' . $hits . ')</td></tr>';
         
         $k++;
      }
   } else {
      // no results (future dates)
      $xAxis = '"12am", "1am", "2am", "3am", "4am", "5am", "6am", "7am", "8am", "9am", "10am", "11am", "12am", "1pm", "2pm", "3pm", "4pm", "5pm", "6pm", "7pm", "8pm", "9pm", "10pm", "11pm"';
      $yAxis = '0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0';
      echo '<tr class="text-left"><td>N/A</td><td class="width65">' . _STATS_NO_RESULT . '</td></tr>';
   }
    echo '</table></noscript>';
    // END NOSCRIPT: only displayed if JavaScript disabled
 
PostPosted: Sun Jan 12, 2014 11:58 am
Reply with quote Back to top
Guardian
Newbie
Newbie
Joined: Sep 22, 2012
Posts: 23

View user's profile Send private message
Wow, my apologies, to you. I know I installed this module but I must have swopped it back for some reason when I had to move my main domain. I'll re-install it tomorrow and take a look.
 
PostPosted: Sun Jan 12, 2014 12:06 pm
Reply with quote Back to top
Guardian
Newbie
Newbie
Joined: Sep 22, 2012
Posts: 23

View user's profile Send private message
Just realised why I swopped it back. My site is commercial so I would be in breach of their license if I used HighCharts. I could buy a license bot right now - need to sell some software first Smile
 
Post new topic Reply to topic Web CMS Designs Forum Index RavenNuke Modules
Your AccountNew Members
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001-2008 phpBB Group
 
 
Raven PHP Scripts