+
+
+
+
+
+
+
+ Title+ +
+ + body here + + + ++ |
+
diff --git a/inc/app/cms/boxes/parallel/approve/CVS/Entries b/inc/app/cms/boxes/parallel/approve/CVS/Entries new file mode 100644 index 00000000..1c8667ac --- /dev/null +++ b/inc/app/cms/boxes/parallel/approve/CVS/Entries @@ -0,0 +1,2 @@ +/index.php/1.1/Tue Feb 20 19:26:57 2007// +D diff --git a/inc/app/cms/boxes/parallel/approve/CVS/Repository b/inc/app/cms/boxes/parallel/approve/CVS/Repository new file mode 100644 index 00000000..287991a0 --- /dev/null +++ b/inc/app/cms/boxes/parallel/approve/CVS/Repository @@ -0,0 +1 @@ +pro/inc/app/cms/boxes/parallel/approve diff --git a/inc/app/cms/boxes/parallel/approve/CVS/Root b/inc/app/cms/boxes/parallel/approve/CVS/Root new file mode 100644 index 00000000..a46761f7 --- /dev/null +++ b/inc/app/cms/boxes/parallel/approve/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@jd:/usr/local/cvsroot diff --git a/inc/app/cms/boxes/parallel/approve/index.php b/inc/app/cms/boxes/parallel/approve/index.php new file mode 100755 index 00000000..6467bd30 --- /dev/null +++ b/inc/app/cms/boxes/parallel/approve/index.php @@ -0,0 +1,16 @@ +approve ($parameters['revision_id'])) { + die ($p->error); +} + +header ('Location: ' . site_prefix () . '/index/' . $parameters['id']); +exit; + +?> \ No newline at end of file diff --git a/inc/app/cms/boxes/parallel/index.php b/inc/app/cms/boxes/parallel/index.php new file mode 100755 index 00000000..e85c7cbf --- /dev/null +++ b/inc/app/cms/boxes/parallel/index.php @@ -0,0 +1,59 @@ +set_goal ($parameters['goal_url']); +} + +function parallel_filter_height ($value, $total, $new_base) { + $div_by = $total / $new_base; + if ($div_by > 0) { + $ret = ceil ($value / $div_by); + if ($ret > 250) { + return 250; + } + if ($ret < 16) { + return 16; + } + return $ret; + } + return 16; +} + +if (empty ($p->goal_url)) { + page_title (intl_get ('Parallel Page') . ': ' . $parameters['id']); + echo template_simple ('parallel_goal.spt', $parameters); +} else { + page_title (intl_get ('Parallel Stats') . ': ' . $parameters['id']); + $parameters['stats'] = $p->get_stats (); + if ($p->total_views == 0) { + echo template_simple ('parallel_nostats.spt'); + return; + } + foreach ($parameters['stats'] as $k => $v) { + $parameters['stats'][$k]['click_height'] = parallel_filter_height ($v['clicked'], $p->total_clicks, 150); + $parameters['stats'][$k]['view_height'] = parallel_filter_height ($v['viewed'], $p->total_views, 450); + } + $parameters['total_views'] = $p->total_views; + $parameters['total_clicks'] = $p->total_clicks; + + loader_import ('saf.Date'); + + $parameters['duration'] = round ((time () - strtotime ($p->campaign_start)) / 86400, 1); + $parameters['goal'] = $p->goal_url; + $parameters['versions'] = count ($parameters['stats']); + + page_add_style ( + template_simple ( + 'parallel_css.spt', + $parameters + ) + ); + echo template_simple ('parallel_stats.spt', $parameters); + //info ($stats, true); +} + +?> \ No newline at end of file diff --git a/inc/app/cms/boxes/parallel/rpc/CVS/Entries b/inc/app/cms/boxes/parallel/rpc/CVS/Entries new file mode 100644 index 00000000..78ac730e --- /dev/null +++ b/inc/app/cms/boxes/parallel/rpc/CVS/Entries @@ -0,0 +1,3 @@ +/access.php/1.1/Tue Feb 20 19:26:57 2007// +/index.php/1.1/Tue Feb 20 19:26:57 2007// +D diff --git a/inc/app/cms/boxes/parallel/rpc/CVS/Repository b/inc/app/cms/boxes/parallel/rpc/CVS/Repository new file mode 100644 index 00000000..1f88e6dc --- /dev/null +++ b/inc/app/cms/boxes/parallel/rpc/CVS/Repository @@ -0,0 +1 @@ +pro/inc/app/cms/boxes/parallel/rpc diff --git a/inc/app/cms/boxes/parallel/rpc/CVS/Root b/inc/app/cms/boxes/parallel/rpc/CVS/Root new file mode 100644 index 00000000..a46761f7 --- /dev/null +++ b/inc/app/cms/boxes/parallel/rpc/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@jd:/usr/local/cvsroot diff --git a/inc/app/cms/boxes/parallel/rpc/access.php b/inc/app/cms/boxes/parallel/rpc/access.php new file mode 100755 index 00000000..d793a6d1 --- /dev/null +++ b/inc/app/cms/boxes/parallel/rpc/access.php @@ -0,0 +1,3 @@ +sitellite_access = public +sitellite_status = approved +sitellite_action = on diff --git a/inc/app/cms/boxes/parallel/rpc/index.php b/inc/app/cms/boxes/parallel/rpc/index.php new file mode 100755 index 00000000..6750c10b --- /dev/null +++ b/inc/app/cms/boxes/parallel/rpc/index.php @@ -0,0 +1,16 @@ + $page_id)); + return $p->clicked ($revision_id); + } +} + +echo rpc_handle (new Parallel_RPC_Handler (), $parameters); +exit; + +?> \ No newline at end of file diff --git a/inc/app/cms/conf/collections/sitebanner_ad.php b/inc/app/cms/conf/collections/sitebanner_ad.php new file mode 100755 index 00000000..d75ffa28 --- /dev/null +++ b/inc/app/cms/conf/collections/sitebanner_ad.php @@ -0,0 +1,163 @@ +; 'Yes', 'no' => 'No')" + +[facet:section] + +type = select +display = Section +values = "loader_call ('sitebanner.MenuSections', 'menu_get_sections')" + +[hint:name] + +alt = Ad Name +rule 1 = not empty, You must enter a name for your ad. + +[hint:purchased] + +type = text +alt = "Purchased Impressions (-1 for unlimited)" + +[hint:impressions] + +type = hidden + +[hint:url] + +alt = URL +extra = "size='40'" + +[hint:description] + +type = textarea +cols = 40 +rows = 2 +labelPosition = left + +[hint:client] + +type = select +setValues = "eval: db_pairs ('select username, concat(role, ` - `, lastname, ` `, firstname, ` (`, username, `)`) as name from sitellite_user order by name asc')" + +[hint:display_url] + +alt = Alternate Text +extra = "size='40'" + +[hint:file] + +type = sitebanner.Widgets.Shapeshifter + +[hint:section] + +type = multiple +size = 5 +alt = Display in Sections +setValues = "eval: array_merge (array ('' => '- ALL -'), loader_call ('sitebanner.MenuSections', 'menu_get_sections'))" + +[hint:position] + +type = selector +alt = Screen Position +table = sitebanner_position +key = name + +[hint:active] + +alt = "Is Active?" + +[hint:format] + +setValues = "eval: array ('external' => 'External Link', 'adsense' => 'Google(TM) AdSense', 'html' => 'HTML', 'image' => 'Image', 'text' => 'Text')" +extra = "onchange='this.form.submit ()'"; + +[hint:target] + +setValues = "eval: array ('blank' => 'New Window', 'parent' => 'Parent Frame', 'self' => 'Same Frame', 'top' => 'Top Frame')" + +; */ ?> \ No newline at end of file diff --git a/inc/app/cms/conf/collections/sitelinks_item.php b/inc/app/cms/conf/collections/sitelinks_item.php new file mode 100755 index 00000000..b36fdac6 --- /dev/null +++ b/inc/app/cms/conf/collections/sitelinks_item.php @@ -0,0 +1,164 @@ +; \ No newline at end of file diff --git a/inc/app/cms/conf/collections/sitellite_form_submission.php b/inc/app/cms/conf/collections/sitellite_form_submission.php index af00f77c..54b8af99 100755 --- a/inc/app/cms/conf/collections/sitellite_form_submission.php +++ b/inc/app/cms/conf/collections/sitellite_form_submission.php @@ -43,6 +43,13 @@ text = Export Contacts url = /index/sitellite-export-form +[link:sitemailer2] + +requires = r +requires resource = app_sitemailer2 +text = "Add to Newsletter" +url = "/index/sitemailer2-import-submissions-form" + [browse:id] header = ID diff --git a/inc/app/cms/conf/collections/sitemailer2_message.php b/inc/app/cms/conf/collections/sitemailer2_message.php new file mode 100755 index 00000000..4076c1c0 --- /dev/null +++ b/inc/app/cms/conf/collections/sitemailer2_message.php @@ -0,0 +1,80 @@ +; diff --git a/inc/app/cms/conf/collections/sitemailer2_recipient.php b/inc/app/cms/conf/collections/sitemailer2_recipient.php new file mode 100755 index 00000000..3f659de5 --- /dev/null +++ b/inc/app/cms/conf/collections/sitemailer2_recipient.php @@ -0,0 +1,106 @@ +; 'Active', 'unverified' => 'Unverified', 'disabled' => 'Disabled')" +count = off + +; */ ?> \ No newline at end of file diff --git a/inc/app/cms/conf/collections/sitemailer2_template.php b/inc/app/cms/conf/collections/sitemailer2_template.php new file mode 100755 index 00000000..eed27884 --- /dev/null +++ b/inc/app/cms/conf/collections/sitemailer2_template.php @@ -0,0 +1,72 @@ +; diff --git a/inc/app/cms/conf/collections/siteshop_product.php b/inc/app/cms/conf/collections/siteshop_product.php new file mode 100755 index 00000000..d9561c81 --- /dev/null +++ b/inc/app/cms/conf/collections/siteshop_product.php @@ -0,0 +1,81 @@ +; \ No newline at end of file diff --git a/inc/app/cms/html/parallel_css.spt b/inc/app/cms/html/parallel_css.spt new file mode 100755 index 00000000..9e52f4b1 --- /dev/null +++ b/inc/app/cms/html/parallel_css.spt @@ -0,0 +1,96 @@ +#parallel-stats-graph { + position: relative; + width: {php obj[versions] x 150}px; + height: 300px; + margin: 1.1em 0 3.5em; + padding: 0; + background: #eee; + border: 1px solid #0081d6; + list-style: none; + font: 9px Helvetica, Geneva, sans-serif; +} + +#parallel-stats-graph ul { + margin: 0; + padding: 0; + list-style: none; +} + +#parallel-stats-graph li { + position: absolute; + bottom: 0; + width: 150px; + z-index: 2; + margin: 0; + padding: 0; + text-align: center; + list-style: none; +} + +#parallel-stats-graph li.version { + height: 298px; + padding-top: 2px; + border-right: 1px solid #ddd; + color: #000; + font-size: 12px; +} + +#parallel-stats-graph li.bar { + width: 60px; + border: 1px solid; + border-bottom: none; + color: #000; + /*font: 9px Helvetica, Arial, sans-serif;*/ +} + +#parallel-stats-graph li.bar p { + margin: 5px 0 0; + padding: 0; +} + +#parallel-stats-graph li.highest { + /*background: #ffc8c8; + border: 1px solid #0081d6;*/ +} + +#parallel-stats-graph li.clicked { + left: 13px; + background: #ceffc8; + border: 0px none; + border-right: 1px solid #A6DA9F; +} + +#parallel-stats-graph li.viewed { + left: 77px; + background: #c7e9ff; + border: 0px none; + border-right: 1px solid #A2C3D9; +} + +{loop obj[stats]} + #parallel-stats-graph #v{loop/_index} { + left: {php (loop[_index] x 150) - 150}px; + {if loop[_index] eq obj[versions]} + border-right: none; + {end if} + } +{end loop} + +#parallel-stats-graph #ticks { + width: {php obj[versions] x 150}px; + height: 300px; + z-index: 1; +} + +#parallel-stats-graph #ticks .tick { + position: relative; + border-bottom: 1px solid #BBB; + width: {php obj[versions] x 150}px; +} + +#parallel-stats-graph #ticks .tick p { + position: absolute; + left: 100%; + top: -0.67em; + margin: 0 0 0 0.5em; +} diff --git a/inc/app/cms/html/parallel_goal.spt b/inc/app/cms/html/parallel_goal.spt new file mode 100755 index 00000000..918f913e --- /dev/null +++ b/inc/app/cms/html/parallel_goal.spt @@ -0,0 +1,12 @@ +
{intl Please enter the complete URL of the goal link to track for this parallel test.}
+{intl The goal link is the link you are trying to direct visitors to follow on this page.}
{intl There are no stats for this test yet. Please check back later.}
+ + diff --git a/inc/app/cms/html/parallel_stats.spt b/inc/app/cms/html/parallel_stats.spt new file mode 100755 index 00000000..5398fc73 --- /dev/null +++ b/inc/app/cms/html/parallel_stats.spt @@ -0,0 +1,32 @@ +{alt #fff #eee} + + + +
{intl Goal Link}: {goal}
+{intl Total Views}: {total_views}
+{intl Total Clicks}: {total_clicks}
+{intl Test Duration}: {duration} {intl days}
diff --git a/inc/app/cms/lib/Product.php b/inc/app/cms/lib/Product.php index 62ba55af..0a954803 100755 --- a/inc/app/cms/lib/Product.php +++ b/inc/app/cms/lib/Product.php @@ -36,6 +36,6 @@ define ('PRODUCT_HEADER_GRAPHIC', site_prefix () . '/inc/app/cms/pix/sitellite-cms.gif'); } -define ('PRODUCT_EDITION', 'Open Source Edition'); +define ('PRODUCT_EDITION', ''); ?> \ No newline at end of file diff --git a/inc/app/cms/lib/Versioning/Parallel.php b/inc/app/cms/lib/Versioning/Parallel.php new file mode 100755 index 00000000..ed552b07 --- /dev/null +++ b/inc/app/cms/lib/Versioning/Parallel.php @@ -0,0 +1,220 @@ +page_id = $pg->id; + } else { + $this->page_id = $pg; + } + $sp = db_single ('select * from sitellite_parallel where page = ?', $this->page_id); + if ($sp) { + $this->parallel_id = $sp->id; + $this->goal_url = $sp->goal; + } else { + db_execute ('insert into sitellite_parallel values (null, ?, "")', $this->page_id); + $this->parallel_id = db_lastid (); + $this->goal_url = ''; + } + } + + function next () { + global $cgi; + + $show = session_get ('parallel_id'); + if ($show && ! $cgi->parallel_show) { + $cgi->parallel_show = $show; + } + + if ($cgi->parallel_show) { + $selected = 0; + $list[$selected] = db_single ('select * from sitellite_page_sv where id = ? and sv_autoid = ?', $this->page_id, $cgi->parallel_show); + } else { + // determine which parallel version to serve + $list = db_fetch_array ('select * from sitellite_page_sv where id = ? order by sv_revision desc limit 10', $this->page_id); + $good = array (); + foreach (array_keys ($list) as $k) { + if ($list[$k]->sitellite_status != 'parallel') { + break; + } + $good[] = $k; + } + + $selected = array_rand ($good); + } + $this->revision_id = $list[$selected]->sv_autoid; + + if (! session_admin ()) { + session_set ('parallel_id', $this->revision_id); + } + + unset ($list[$selected]->sv_autoid); + unset ($list[$selected]->sv_author); + unset ($list[$selected]->sv_action); + unset ($list[$selected]->sv_revision); + unset ($list[$selected]->sv_changelog); + unset ($list[$selected]->sv_deleted); + unset ($list[$selected]->sv_current); + + // load javascript for goal tracking + $this->load_script (); + + // track view + $this->viewed (); + + return $list[$selected]; + } + + function viewed () { + // track view + if (! session_admin ()) { + return db_execute ( + 'insert into sitellite_parallel_view values (?, ?, now())', + $this->parallel_id, + $this->revision_id + ); + } + } + + function clicked ($revision_id) { + // track click + if (! session_admin ()) { + return db_execute ( + 'insert into sitellite_parallel_click values (?, ?, now())', + $this->parallel_id, + $revision_id + ); + } + } + + function load_script () { + page_add_script (site_prefix () . '/js/rpc.js'); + page_add_script (site_prefix () . '/js/parallel.js'); + page_add_script (' + var parallel_script_url = "' . site_prefix () . '/index/cms-parallel-rpc-action"; + var parallel_page_id = "' . $this->page_id . '"; + var parallel_revision_id = "' . $this->revision_id . '"; + var parallel_goal_url = "' . $this->goal_url . '"; + '); + } + + function set_goal ($goal) { + db_execute ( + 'update sitellite_parallel set goal = ? where id = ?', + $goal, + $this->parallel_id + ); + $this->goal_url = $goal; + } + + function get_stats () { + $stats = array (); + $list = db_fetch_array ('select * from sitellite_page_sv where id = ? order by sv_revision desc limit 10', $this->page_id); + $good = array (); + foreach (array_keys ($list) as $k) { + if ($list[$k]->sitellite_status != 'parallel') { + break; + } + $good[] = $k; + } + + $highest_id = 0; + $oldest_id = 0; + $highest = 0; + $oldest = false; + + $good = array_reverse ($good); + + foreach ($good as $k) { + $stats[$list[$k]->sv_autoid] = array ( + 'description' => $list[$k]->sv_changelog, + 'ts' => $list[$k]->sv_revision, + 'viewed' => db_shift ('select count(*) from sitellite_parallel_view where parallel_id = ? and revision_id = ?', $this->parallel_id, $list[$k]->sv_autoid), + 'clicked' => db_shift ('select count(*) from sitellite_parallel_click where parallel_id = ? and revision_id = ?', $this->parallel_id, $list[$k]->sv_autoid), + 'highest' => false, + 'oldest' => false, + ); + if ($stats[$list[$k]->sv_autoid]['viewed'] > 0) { + $stats[$list[$k]->sv_autoid]['ratio'] = ($stats[$list[$k]->sv_autoid]['clicked'] / $stats[$list[$k]->sv_autoid]['viewed']) * 100; + } else { + $stats[$list[$k]->sv_autoid]['ratio'] = 0; + } + if ($stats[$list[$k]->sv_autoid]['ratio'] > $highest) { + $highest = $stats[$list[$k]->sv_autoid]['ratio']; + $highest_id = $list[$k]->sv_autoid; + } + if ($oldest == false || $stats[$list[$k]->sv_autoid]['ts'] < $oldest) { + $oldest = $stats[$list[$k]->sv_autoid]['ts']; + $oldest_id = $list[$k]->sv_autoid; + } + $this->total_views += $stats[$list[$k]->sv_autoid]['viewed']; + $this->total_clicks += $stats[$list[$k]->sv_autoid]['clicked']; + } + if ($highest_id) { + $stats[$highest_id]['highest'] = true; + } + $stats[$oldest_id]['oldest'] = true; + $this->campaign_start = $stats[$oldest_id]['ts']; + return $stats; + } + + function clear_series () { + db_execute ('delete from sitellite_parallel where id = ?', $this->parallel_id); + db_execute ('delete from sitellite_parallel_view where parallel_id = ?', $this->parallel_id); + db_execute ('delete from sitellite_parallel_click where parallel_id = ?', $this->parallel_id); + } + + function approve ($revision_id = false) { + if (! $revision_id) { + $revision_id = $this->revision_id; + } + + loader_import ('cms.Versioning.Rex'); + + $rex = new Rex ('sitellite_page'); + + $info = db_single ( + 'select * from sitellite_page_sv where id = ? and sv_autoid = ?', + $this->page_id, + $revision_id + ); + + unset ($info->sv_autoid); + unset ($info->sv_author); + unset ($info->sv_action); + unset ($info->sv_revision); + unset ($info->sv_changelog); + unset ($info->sv_deleted); + unset ($info->sv_current); + + $method = $rex->determineAction ($this->page_id, 'approved'); + if (! $method) { + $this->error = $rex->error; + return false; + } + + $info = (array) $info; + $info['sitellite_status'] = 'approved'; + + $res = $rex->{$method} ($this->page_id, $info, intl_get ('Approved from parallel testing campaign')); + if (! $res) { + $this->error = $rex->error; + return false; + } + + $this->clear_series (); + + return true; + } +} + +?> \ No newline at end of file diff --git a/inc/app/sitebanner/boxes/access.php b/inc/app/sitebanner/boxes/access.php new file mode 100644 index 00000000..13777b5d --- /dev/null +++ b/inc/app/sitebanner/boxes/access.php @@ -0,0 +1,7 @@ +; diff --git a/inc/app/sitebanner/boxes/click/index.php b/inc/app/sitebanner/boxes/click/index.php new file mode 100644 index 00000000..1b6b883e --- /dev/null +++ b/inc/app/sitebanner/boxes/click/index.php @@ -0,0 +1,28 @@ +client != session_username ()) { + db_execute ( + 'insert into sitebanner_click + (id, campaign, ip, ts, ua) + values + (null, ?, ?, now(), ?)', + $parameters['id'], + $_SERVER['REMOTE_ADDR'], + $_SERVER['HTTP_USER_AGENT'] + ); +} + +header ('Location: ' . $banner->url); +exit; + +?> \ No newline at end of file diff --git a/inc/app/sitebanner/boxes/client/index.php b/inc/app/sitebanner/boxes/client/index.php new file mode 100644 index 00000000..5b8db3af --- /dev/null +++ b/inc/app/sitebanner/boxes/client/index.php @@ -0,0 +1,36 @@ +impressions = sitebanner_filter_impressions ($banners[$k]->impressions); + $banners[$k]->purchased = sitebanner_filter_purchased ($banners[$k]->purchased); + $banners[$k]->clicks = sitebanner_virtual_clicks ($banners[$k]); + $banners[$k]->clicks_percent = sitebanner_virtual_clicks_percent ($banners[$k]); +} + +echo template_simple ( + 'client.spt', + array ( + 'list' => $banners, + ) +); + +?> \ No newline at end of file diff --git a/inc/app/sitebanner/boxes/display/access.php b/inc/app/sitebanner/boxes/display/access.php new file mode 100644 index 00000000..fec3b1c7 --- /dev/null +++ b/inc/app/sitebanner/boxes/display/access.php @@ -0,0 +1,8 @@ +; diff --git a/inc/app/sitebanner/boxes/display/index.php b/inc/app/sitebanner/boxes/display/index.php new file mode 100644 index 00000000..bf309886 --- /dev/null +++ b/inc/app/sitebanner/boxes/display/index.php @@ -0,0 +1,84 @@ +client != session_username ()) { + db_execute ( + 'update sitebanner_ad set impressions = impressions + 1 where id = ?', + $banners[$key] + ); + + db_execute ( + 'insert into sitebanner_view + (id, campaign, ip, ts, ua) + values + (null, ?, ?, now(), ?)', + $banners[$key], + $_SERVER['REMOTE_ADDR'], + $_SERVER['HTTP_USER_AGENT'] + ); +} + +if ($banner->format == 'image') { // get image width/height + $info = parse_url ($banner->file); + if (strpos ($info['path'], '/') === 0) { + $info['path'] = substr ($info['path'], 1); + } + $dimensions = getimagesize ($info['path']); + $banner->width = $dimensions[0]; + $banner->height = $dimensions[1]; +} elseif ($banner->format == 'adsense') { // display only one google ad per page + if (defined ('SITEBANNER_ADSENSE')) { + return; + } + //define ('SITEBANNER_ADSENSE', true); +} + +if ($box['context'] == 'action') { + echo template_simple ('display/' . $banner->format . '_action.spt', $banner); + exit; +} + +echo template_simple ('display/' . $banner->format . '.spt', $banner); + +?> \ No newline at end of file diff --git a/inc/app/sitebanner/boxes/display/settings.php b/inc/app/sitebanner/boxes/display/settings.php new file mode 100755 index 00000000..e2f0e742 --- /dev/null +++ b/inc/app/sitebanner/boxes/display/settings.php @@ -0,0 +1,14 @@ +; \ No newline at end of file diff --git a/inc/app/sitebanner/boxes/stats/client/index.php b/inc/app/sitebanner/boxes/stats/client/index.php new file mode 100644 index 00000000..a16162bf --- /dev/null +++ b/inc/app/sitebanner/boxes/stats/client/index.php @@ -0,0 +1,220 @@ +_range)) { + $cgi->_range = 'week'; +} + +if (! isset ($cgi->date)) { + $cgi->date = date ('Y-m-d'); +} + +if (! isset ($cgi->id)) { + header ('Location: ' . site_prefix () . '/index'); + exit; +} + +if (session_username () != db_shift ('select client from sitebanner_ad where id = ?', $cgi->id)) { + header ('Location: ' . site_prefix () . '/index'); + exit; +} + +$data = array (); + +$rex = new Rex (false); + +$rex->facets['range'] = new rSelectFacet ('range', array ('display' => intl_get ('Date Range'), 'type' => 'select')); +$rex->facets['range']->preserve = array ('date', 'id'); +$rex->facets['range']->options = array ( + 'day' => intl_get ('Day'), + 'week' => intl_get ('Week'), + 'month' => intl_get ('Month'), + 'year' => intl_get ('Year'), +); +$rex->facets['range']->count = false; +$rex->facets['range']->all = false; + +$data['facets'] = $rex->renderFacets (1); +$data['bookmark'] = true; + +$data['date'] = $cgi->date; +$data['previous'] = Date::subtract ($cgi->date, '1 ' . $cgi->_range); +$data['next'] = Date::add ($cgi->date, '1 ' . $cgi->_range); + +switch ($cgi->_range) { + case 'day': + $parts = array ( + 'Midnight-1am' => array ($cgi->date . ' 00:00:00', $cgi->date . ' 00:59:59'), + '1:00-2:00' => array ($cgi->date . ' 01:00:00', $cgi->date . ' 01:59:59'), + '2:00-3:00' => array ($cgi->date . ' 02:00:00', $cgi->date . ' 02:59:59'), + '3:00-4:00' => array ($cgi->date . ' 03:00:00', $cgi->date . ' 03:59:59'), + '4:00-5:00' => array ($cgi->date . ' 04:00:00', $cgi->date . ' 04:59:59'), + '5:00-6:00' => array ($cgi->date . ' 05:00:00', $cgi->date . ' 05:59:59'), + '6:00-7:00' => array ($cgi->date . ' 06:00:00', $cgi->date . ' 06:59:59'), + '7:00-8:00' => array ($cgi->date . ' 07:00:00', $cgi->date . ' 07:59:59'), + '8:00-9:00' => array ($cgi->date . ' 08:00:00', $cgi->date . ' 08:59:59'), + '9:00-10:00' => array ($cgi->date . ' 09:00:00', $cgi->date . ' 09:59:59'), + '10:00-11:00' => array ($cgi->date . ' 10:00:00', $cgi->date . ' 10:59:59'), + '11am-Noon' => array ($cgi->date . ' 11:00:00', $cgi->date . ' 11:59:59'), + 'Noon-1:00' => array ($cgi->date . ' 12:00:00', $cgi->date . ' 12:59:59'), + '1:00-2:00 ' => array ($cgi->date . ' 13:00:00', $cgi->date . ' 13:59:59'), + '2:00-3:00 ' => array ($cgi->date . ' 14:00:00', $cgi->date . ' 14:59:59'), + '3:00-4:00 ' => array ($cgi->date . ' 15:00:00', $cgi->date . ' 15:59:59'), + '4:00-5:00 ' => array ($cgi->date . ' 16:00:00', $cgi->date . ' 16:59:59'), + '5:00-6:00 ' => array ($cgi->date . ' 17:00:00', $cgi->date . ' 17:59:59'), + '6:00-7:00 ' => array ($cgi->date . ' 18:00:00', $cgi->date . ' 18:59:59'), + '7:00-8:00 ' => array ($cgi->date . ' 19:00:00', $cgi->date . ' 19:59:59'), + '8:00-9:00 ' => array ($cgi->date . ' 20:00:00', $cgi->date . ' 20:59:59'), + '9:00-10:00 ' => array ($cgi->date . ' 21:00:00', $cgi->date . ' 21:59:59'), + '10:00-11:00 ' => array ($cgi->date . ' 22:00:00', $cgi->date . ' 22:59:59'), + '11pm-Midnight' => array ($cgi->date . ' 23:00:00', $cgi->date . ' 23:59:59'), + ); + break; + case 'week': + $day = strtolower (date ('D', strtotime ($cgi->date))); + $days = array ('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'); + $key = array_search ($day, $days); + if ($key === false) { + return; + } + $orig = $key; + + loader_import ('saf.Date'); + + while ($key >= 0) { + $minus = $orig - $key; + + if ($orig == $key) { + ${'_' . $day} = $cgi->date; + } else { + ${'_' . $days[$key]} = Date::subtract ($cgi->date, abs ($minus) . ' days'); + } + + $key--; + } + + $key = $orig; + $c = 0; + while ($key <= 6) { + $add = $key - $orig; + + if ($orig != $key) { + ${'_' . $days[$key]} = Date::add ($cgi->date, $add . ' days'); + } + + $key++; + } + + $parts = array ( + intl_get ('Sunday') => array ($_sun . ' 00:00:00', $_sun . ' 23:59:59'), + intl_get ('Monday') => array ($_mon . ' 00:00:00', $_mon . ' 23:59:59'), + intl_get ('Tuesday') => array ($_tue . ' 00:00:00', $_tue . ' 23:59:59'), + intl_get ('Wednesday') => array ($_wed . ' 00:00:00', $_wed . ' 23:59:59'), + intl_get ('Thursday') => array ($_thu . ' 00:00:00', $_thu . ' 23:59:59'), + intl_get ('Friday') => array ($_fri . ' 00:00:00', $_fri . ' 23:59:59'), + intl_get ('Saturday') => array ($_sat . ' 00:00:00', $_sat . ' 23:59:59'), + ); + break; + case 'month': + list ($y, $m, $d) = split ('-', $cgi->date); + if ($y . '-' . $m == date ('Y-m')) { + $days = date ('d'); + } else { + $days = date ('t', strtotime ($cgi->date)); + } + $parts = array (); + for ($i = 1; $i <= $days; $i++) { + $parts[date ('jS', strtotime ($y . '-' . $m . '-' . str_pad ($i, 2, '0', STR_PAD_LEFT)))] = array ( + $y . '-' . $m . '-' . str_pad ($i, 2, '0', STR_PAD_LEFT) . ' 00:00:00', + $y . '-' . $m . '-' . str_pad ($i, 2, '0', STR_PAD_LEFT) . ' 23:59:59', + ); + } + break; + case 'year': + list ($y, $m, $d) = split ('-', $cgi->date); + $parts = array ( + intl_get ('January') => array ($y . '-01-01 00:00:00', $y . '-01-31 23:59:59'), + intl_get ('February') => array ($y . '-02-01 00:00:00', $y . '-02-31 23:59:59'), + intl_get ('March') => array ($y . '-03-01 00:00:00', $y . '-03-31 23:59:59'), + intl_get ('April') => array ($y . '-04-01 00:00:00', $y . '-04-31 23:59:59'), + intl_get ('May') => array ($y . '-05-01 00:00:00', $y . '-05-31 23:59:59'), + intl_get ('June') => array ($y . '-06-01 00:00:00', $y . '-06-31 23:59:59'), + intl_get ('July') => array ($y . '-07-01 00:00:00', $y . '-07-31 23:59:59'), + intl_get ('August') => array ($y . '-08-01 00:00:00', $y . '-08-31 23:59:59'), + intl_get ('September') => array ($y . '-09-01 00:00:00', $y . '-09-31 23:59:59'), + intl_get ('October') => array ($y . '-10-01 00:00:00', $y . '-10-31 23:59:59'), + intl_get ('November') => array ($y . '-11-01 00:00:00', $y . '-11-31 23:59:59'), + intl_get ('December') => array ($y . '-12-01 00:00:00', $y . '-12-31 23:59:59'), + ); + break; +} + +$data['parts'] = array (); +$data['views_total'] = 0; +$data['clicks_total'] = 0; +$data['ctr_total'] = 0; +$count = 0; + +foreach ($parts as $k => $range) { + $views = db_shift ( + 'select count(*) from sitebanner_view where ts >= ? and ts <= ? and campaign = ?', + $range[0], + $range[1], + $cgi->id + ); + $clicks = db_shift ( + 'select count(*) from sitebanner_click where ts >= ? and ts <= ? and campaign = ?', + $range[0], + $range[1], + $cgi->id + ); + $ctr = @number_format (($clicks / $views) * 100, 2); + + $data['parts'][] = array ( + 'part' => $k, + 'from' => $range[0], + 'to' => $range[1], + 'views' => $views, + 'clicks' => $clicks, + 'ctr' => $ctr, + ); + + if ($views > 0) { + $count++; + } + $data['views_total'] += $views; + $data['clicks_total'] += $clicks; + $data['ctr_total'] += $ctr; +} + +$data['views_avg'] = @number_format (ceil ($data['views_total'] / $count), 0); +$data['clicks_avg'] = @number_format (ceil ($data['clicks_total'] / $count), 0); +$data['ctr_avg'] = @number_format ($data['ctr_total'] / $count, 2); + +$data['ctr_total'] = @number_format ($data['ctr_total'], 2); + +if ($cgi->csv == 'true') { + $data['title'] = intl_get ('Banner Stats') . ': ' . db_shift ( + 'select name from sitebanner_ad where id = ?', + $cgi->id + ) . ', ' . sitebanner_filter_date ($cgi->date); + + header ('Content-Type: application/octet-stream'); + header ('Content-Disposition: attachment; filename="csv.txt"'); + echo template_simple ('stats_csv.spt', $data); + exit; +} else { + page_title (intl_get ('Banner Stats') . ': ' . db_shift ( + 'select name from sitebanner_ad where id = ?', + $cgi->id + )); + + echo template_simple ('stats_client.spt', $data); +} + +?> \ No newline at end of file diff --git a/inc/app/sitebanner/boxes/stats/index.php b/inc/app/sitebanner/boxes/stats/index.php new file mode 100644 index 00000000..1afaed00 --- /dev/null +++ b/inc/app/sitebanner/boxes/stats/index.php @@ -0,0 +1,221 @@ +_range)) { + $cgi->_range = 'week'; +} + +if (! isset ($cgi->date)) { + $cgi->date = date ('Y-m-d'); +} + +if (! isset ($cgi->id)) { + header ('Location: ' . site_prefix () . '/index/cms-browse-action?collection=sitebanner_ad'); + exit; +} + +$data = array (); + +$rex = new Rex (false); + +$rex->facets['range'] = new rSelectFacet ('range', array ('display' => intl_get ('Date Range'), 'type' => 'select')); +$rex->facets['range']->preserve = array ('date', 'id'); +$rex->facets['range']->options = array ( + 'day' => intl_get ('Day'), + 'week' => intl_get ('Week'), + 'month' => intl_get ('Month'), + 'year' => intl_get ('Year'), +); +$rex->facets['range']->count = false; +$rex->facets['range']->all = false; + +$data['facets'] = $rex->renderFacets (1); +$data['bookmark'] = true; + +$data['date'] = $cgi->date; +$data['previous'] = Date::subtract ($cgi->date, '1 ' . $cgi->_range); +$data['next'] = Date::add ($cgi->date, '1 ' . $cgi->_range); + +switch ($cgi->_range) { + case 'day': + $parts = array ( + 'Midnight-1am' => array ($cgi->date . ' 00:00:00', $cgi->date . ' 00:59:59'), + '1:00-2:00' => array ($cgi->date . ' 01:00:00', $cgi->date . ' 01:59:59'), + '2:00-3:00' => array ($cgi->date . ' 02:00:00', $cgi->date . ' 02:59:59'), + '3:00-4:00' => array ($cgi->date . ' 03:00:00', $cgi->date . ' 03:59:59'), + '4:00-5:00' => array ($cgi->date . ' 04:00:00', $cgi->date . ' 04:59:59'), + '5:00-6:00' => array ($cgi->date . ' 05:00:00', $cgi->date . ' 05:59:59'), + '6:00-7:00' => array ($cgi->date . ' 06:00:00', $cgi->date . ' 06:59:59'), + '7:00-8:00' => array ($cgi->date . ' 07:00:00', $cgi->date . ' 07:59:59'), + '8:00-9:00' => array ($cgi->date . ' 08:00:00', $cgi->date . ' 08:59:59'), + '9:00-10:00' => array ($cgi->date . ' 09:00:00', $cgi->date . ' 09:59:59'), + '10:00-11:00' => array ($cgi->date . ' 10:00:00', $cgi->date . ' 10:59:59'), + '11am-Noon' => array ($cgi->date . ' 11:00:00', $cgi->date . ' 11:59:59'), + 'Noon-1:00' => array ($cgi->date . ' 12:00:00', $cgi->date . ' 12:59:59'), + '1:00-2:00 ' => array ($cgi->date . ' 13:00:00', $cgi->date . ' 13:59:59'), + '2:00-3:00 ' => array ($cgi->date . ' 14:00:00', $cgi->date . ' 14:59:59'), + '3:00-4:00 ' => array ($cgi->date . ' 15:00:00', $cgi->date . ' 15:59:59'), + '4:00-5:00 ' => array ($cgi->date . ' 16:00:00', $cgi->date . ' 16:59:59'), + '5:00-6:00 ' => array ($cgi->date . ' 17:00:00', $cgi->date . ' 17:59:59'), + '6:00-7:00 ' => array ($cgi->date . ' 18:00:00', $cgi->date . ' 18:59:59'), + '7:00-8:00 ' => array ($cgi->date . ' 19:00:00', $cgi->date . ' 19:59:59'), + '8:00-9:00 ' => array ($cgi->date . ' 20:00:00', $cgi->date . ' 20:59:59'), + '9:00-10:00 ' => array ($cgi->date . ' 21:00:00', $cgi->date . ' 21:59:59'), + '10:00-11:00 ' => array ($cgi->date . ' 22:00:00', $cgi->date . ' 22:59:59'), + '11pm-Midnight' => array ($cgi->date . ' 23:00:00', $cgi->date . ' 23:59:59'), + ); + break; + case 'week': + $day = strtolower (date ('D', strtotime ($cgi->date))); + $days = array ('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'); + $key = array_search ($day, $days); + if ($key === false) { + return; + } + $orig = $key; + + loader_import ('saf.Date'); + + while ($key >= 0) { + $minus = $orig - $key; + + if ($orig == $key) { + ${'_' . $day} = $cgi->date; + } else { + ${'_' . $days[$key]} = Date::subtract ($cgi->date, abs ($minus) . ' days'); + } + + $key--; + } + + $key = $orig; + $c = 0; + while ($key <= 6) { + $add = $key - $orig; + + if ($orig != $key) { + ${'_' . $days[$key]} = Date::add ($cgi->date, $add . ' days'); + } + + $key++; + } + + $parts = array ( + intl_get ('Sunday') => array ($_sun . ' 00:00:00', $_sun . ' 23:59:59'), + intl_get ('Monday') => array ($_mon . ' 00:00:00', $_mon . ' 23:59:59'), + intl_get ('Tuesday') => array ($_tue . ' 00:00:00', $_tue . ' 23:59:59'), + intl_get ('Wednesday') => array ($_wed . ' 00:00:00', $_wed . ' 23:59:59'), + intl_get ('Thursday') => array ($_thu . ' 00:00:00', $_thu . ' 23:59:59'), + intl_get ('Friday') => array ($_fri . ' 00:00:00', $_fri . ' 23:59:59'), + intl_get ('Saturday') => array ($_sat . ' 00:00:00', $_sat . ' 23:59:59'), + ); + break; + case 'month': + list ($y, $m, $d) = split ('-', $cgi->date); + if ($y . '-' . $m == date ('Y-m')) { + $days = date ('d'); + } else { + $days = date ('t', strtotime ($cgi->date)); + } + $parts = array (); + for ($i = 1; $i <= $days; $i++) { + $parts[date ('jS', strtotime ($y . '-' . $m . '-' . str_pad ($i, 2, '0', STR_PAD_LEFT)))] = array ( + $y . '-' . $m . '-' . str_pad ($i, 2, '0', STR_PAD_LEFT) . ' 00:00:00', + $y . '-' . $m . '-' . str_pad ($i, 2, '0', STR_PAD_LEFT) . ' 23:59:59', + ); + } + break; + case 'year': + list ($y, $m, $d) = split ('-', $cgi->date); + $parts = array ( + intl_get ('January') => array ($y . '-01-01 00:00:00', $y . '-01-31 23:59:59'), + intl_get ('February') => array ($y . '-02-01 00:00:00', $y . '-02-31 23:59:59'), + intl_get ('March') => array ($y . '-03-01 00:00:00', $y . '-03-31 23:59:59'), + intl_get ('April') => array ($y . '-04-01 00:00:00', $y . '-04-31 23:59:59'), + intl_get ('May') => array ($y . '-05-01 00:00:00', $y . '-05-31 23:59:59'), + intl_get ('June') => array ($y . '-06-01 00:00:00', $y . '-06-31 23:59:59'), + intl_get ('July') => array ($y . '-07-01 00:00:00', $y . '-07-31 23:59:59'), + intl_get ('August') => array ($y . '-08-01 00:00:00', $y . '-08-31 23:59:59'), + intl_get ('September') => array ($y . '-09-01 00:00:00', $y . '-09-31 23:59:59'), + intl_get ('October') => array ($y . '-10-01 00:00:00', $y . '-10-31 23:59:59'), + intl_get ('November') => array ($y . '-11-01 00:00:00', $y . '-11-31 23:59:59'), + intl_get ('December') => array ($y . '-12-01 00:00:00', $y . '-12-31 23:59:59'), + ); + break; +} + +$data['parts'] = array (); +$data['views_total'] = 0; +$data['clicks_total'] = 0; +$data['ctr_total'] = 0; +$count = 0; + +foreach ($parts as $k => $range) { + $views = db_shift ( + 'select count(*) from sitebanner_view where ts >= ? and ts <= ? and campaign = ?', + $range[0], + $range[1], + $cgi->id + ); + $clicks = db_shift ( + 'select count(*) from sitebanner_click where ts >= ? and ts <= ? and campaign = ?', + $range[0], + $range[1], + $cgi->id + ); + $ctr = @number_format (($clicks / $views) * 100, 2); + + $data['parts'][] = array ( + 'part' => $k, + 'from' => $range[0], + 'to' => $range[1], + 'views' => $views, + 'clicks' => $clicks, + 'ctr' => $ctr, + ); + + if ($views > 0) { + $count++; + } + $data['views_total'] += $views; + $data['clicks_total'] += $clicks; + $data['ctr_total'] += $ctr; +} + +$data['views_avg'] = @number_format (ceil ($data['views_total'] / $count), 0); +$data['clicks_avg'] = @number_format (ceil ($data['clicks_total'] / $count), 0); +$data['ctr_avg'] = @number_format ($data['ctr_total'] / $count, 2); + +$data['ctr_total'] = @number_format ($data['ctr_total'], 2); + +if ($cgi->csv == 'true') { + $data['title'] = intl_get ('Banner Stats') . ': ' . db_shift ( + 'select name from sitebanner_ad where id = ?', + $cgi->id + ) . ', ' . sitebanner_filter_date ($cgi->date); + + header ('Content-Type: application/octet-stream'); + header ('Content-Disposition: attachment; filename="csv.txt"'); + echo template_simple ('stats_csv.spt', $data); + exit; +} else { + page_title (intl_get ('Banner Stats') . ': ' . db_shift ( + 'select name from sitebanner_ad where id = ?', + $cgi->id + )); + + page_template_set ('admin'); + echo template_simple ('stats.spt', $data); +} + +?> \ No newline at end of file diff --git a/inc/app/sitebanner/conf/config.ini.php b/inc/app/sitebanner/conf/config.ini.php new file mode 100755 index 00000000..6cee57ed --- /dev/null +++ b/inc/app/sitebanner/conf/config.ini.php @@ -0,0 +1,24 @@ +; diff --git a/inc/app/sitebanner/conf/properties.php b/inc/app/sitebanner/conf/properties.php new file mode 100755 index 00000000..caf96d6d --- /dev/null +++ b/inc/app/sitebanner/conf/properties.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/inc/app/sitebanner/data/hosting-small.jpg b/inc/app/sitebanner/data/hosting-small.jpg new file mode 100755 index 00000000..25b220fb Binary files /dev/null and b/inc/app/sitebanner/data/hosting-small.jpg differ diff --git a/inc/app/sitebanner/data/multisite-small.jpg b/inc/app/sitebanner/data/multisite-small.jpg new file mode 100755 index 00000000..5bb8fd64 Binary files /dev/null and b/inc/app/sitebanner/data/multisite-small.jpg differ diff --git a/inc/app/sitebanner/forms/access.php b/inc/app/sitebanner/forms/access.php new file mode 100644 index 00000000..13777b5d --- /dev/null +++ b/inc/app/sitebanner/forms/access.php @@ -0,0 +1,7 @@ +; diff --git a/inc/app/sitebanner/forms/create/index.php b/inc/app/sitebanner/forms/create/index.php new file mode 100644 index 00000000..ee13c795 --- /dev/null +++ b/inc/app/sitebanner/forms/create/index.php @@ -0,0 +1,36 @@ +parseSettings ('inc/app/sitebanner/forms/create/settings.php'); + page_title (intl_get ('Create a New Banner')); + } + function onSubmit ($vals) { + db_execute ( + 'insert into sitebanner_ad + (id, name, description, client, purchased, impressions, display_url, url, target, format, file, section, position, active) + values + (null, ?, ?, ?, 0, 0, ?, ?, ?, ?, ?, ?, ?, "no")', + $vals['name'], + $vals['description'], + session_username (), + $vals['display_url'], + $vals['url'], + 'top', + 'external', + $vals['file'], + $vals['section'], + $vals['position'] + ); + + if (appconf ('email')) { + @mail (appconf ('email'), 'SiteBanner Submission Notice', template_simple ('create_email.spt', $vals)); + } + + page_title (intl_get ('Banner Created')); + echo template_simple ('create_reply.spt'); + } +} + +?> \ No newline at end of file diff --git a/inc/app/sitebanner/forms/create/settings.php b/inc/app/sitebanner/forms/create/settings.php new file mode 100644 index 00000000..a7879ce6 --- /dev/null +++ b/inc/app/sitebanner/forms/create/settings.php @@ -0,0 +1,54 @@ +; \ No newline at end of file diff --git a/inc/app/sitebanner/html/client.spt b/inc/app/sitebanner/html/client.spt new file mode 100644 index 00000000..3c59bcc1 --- /dev/null +++ b/inc/app/sitebanner/html/client.spt @@ -0,0 +1,26 @@ +{intl Banner} | +{intl Impressions} | +{intl Remaining} | +{intl Clicks} | +% | +{intl Active} | +
---|---|---|---|---|---|
+ {loop/name} + | +{loop/impressions} | +{loop/purchased} | +{loop/clicks} | +{loop/clicks_percent} | +{filter ucfirst}{loop/active}{end filter} | +
{intl Your banner has been received, and we will be in touch with you shortly.}
diff --git a/inc/app/sitebanner/html/display.spt b/inc/app/sitebanner/html/display.spt new file mode 100644 index 00000000..85390846 --- /dev/null +++ b/inc/app/sitebanner/html/display.spt @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/inc/app/sitebanner/html/display/adsense.spt b/inc/app/sitebanner/html/display/adsense.spt new file mode 100644 index 00000000..9bc0b3ea --- /dev/null +++ b/inc/app/sitebanner/html/display/adsense.spt @@ -0,0 +1 @@ +{filter none}{file}{end filter} \ No newline at end of file diff --git a/inc/app/sitebanner/html/display/adsense_action.spt b/inc/app/sitebanner/html/display/adsense_action.spt new file mode 100644 index 00000000..5ba4d767 --- /dev/null +++ b/inc/app/sitebanner/html/display/adsense_action.spt @@ -0,0 +1,36 @@ + + + + ++ {filter none}{loop/_value}{end filter} + | + {end loop} +
+ {intl Back} + + {intl Save as CSV} +
+ ++ {filter none}{facets}{end filter} +
+ ++
+ {intl Previous}: {filter sitebanner_filter_date}{previous}{end filter} + | ++ {filter sitebanner_filter_date}{date}{end filter} + | ++ {intl Next}: {filter sitebanner_filter_date}{next}{end filter} + | +
+
+ | {intl Views} | +{intl Clicks} | +{intl CTR} | +
---|---|---|---|
{if loop[link]}{loop/part}{end if}{if else}{loop/part}{end if} | +{loop/views} | +{loop/clicks} | +{loop/ctr}% | +
{intl Average} + | {views_avg} | +{clicks_avg} | +{ctr_avg}% | +
{intl Total} | +{views_total} | +{clicks_total} | +{ctr_total}% | +
+ {filter none}{facets}{end filter} +
+ ++
+ {intl Previous}: {filter sitebanner_filter_date}{previous}{end filter} + | ++ {filter sitebanner_filter_date}{date}{end filter} + | ++ {intl Next}: {filter sitebanner_filter_date}{next}{end filter} + | +
+
+ | {intl Views} | +{intl Clicks} | +{intl CTR} | +
---|---|---|---|
{if loop[link]}{loop/part}{end if}{if else}{loop/part}{end if} | +{loop/views} | +{loop/clicks} | +{loop/ctr}% | +
{intl Average} + | {views_avg} | +{clicks_avg} | +{ctr_avg}% | +
{intl Total} | +{views_total} | +{clicks_total} | +{ctr_total}% | +
+ * validation ('is "foo"');
+ * $widget->setValue ('foo');
+ * $widget->error_message = 'Oops! This widget is being unruly!';
+ *
+ * ? >
+ *
+ *
+ * @package MailForm
+ * @author John Luxford 1. From the Unix command-line, enter the following:
+ + +
mysql -p -u USER DBNAME < inc/app/sitelinks/install/install-mysql.sql
+
+
+Then enter your password when prompted. You may also use an
+alternate MySQL client, such as phpMyAdmin, if you prefer. This will
+create the necessary database tables that SiteTracker needs to store
+your site traffic information.
+
2. Copy the SiteLinks collection definition file into the global location:
+
+
cp inc/app/sitelinks/install/sitelinks_item.php inc/app/cms/conf/collections/
You should now be ready to start creating links for your web site.
+
http://www.yourWebSite.com/index/sitelinks-app+This will load the main SiteLinks screen.
;<?php /* + +[Type] + +name = Software + +[version] + +type = text + +[cost] + +type = select +setValues = "eval: formdata_get ('types_software_cost')" + +[platform] + +type = select +setValues = "eval: formdata_get ('types_software_platform')" + +; */ ?>The formdata_get() function calls are retrieving lists of select options defined in inc/app/sitelinks/conf/properties.php
+
+{if obj.drafts gt 0}
+ {intl There are} {drafts} {intl links pending approval.} +{end if} +{if else} +{intl There are no links pending approval.} +{end if} + |
+ + + | +
+
+ {filter sitelinks_filter_shortdate}{top_prev}{end filter} + | ++ {filter sitelinks_filter_shortdate}{top_date}{end filter} + | ++ {filter sitelinks_filter_shortdate}{top_next}{end filter} + | +
+
{intl Rank} | +# {intl of Views} | +{intl Link} | +
---|---|---|
{loop/_index} | +{loop/total} | +{filter sitelinks_filter_get_title}{loop/item_id}{end filter} | +
+
{intl Rank} | +# {intl of Hits} | +{intl Link} | +
---|---|---|
{loop/_index} | +{loop/total} | +{filter sitelinks_filter_get_title}{loop/item_id}{end filter} | +
+
{intl Rank} | +{intl Rating} | +{intl Votes} | +{intl Link} | +
---|---|---|---|
{loop/_index} | +{loop/rating} | +{loop/votes} | +{filter sitelinks_filter_get_title}{loop/item_id}{end filter} | +
+ {intl Search} + {if appconf ('user_submissions')} + + {intl My} {appconf/sitelinks_name} + + {intl Newest Links} + {end if} + {if appconf ('user_ratings')} + + {intl Top Listings} + {end if} + {if appconf ('browse_by_type')} + + {intl Browse By Type} + {end if} +
+{end if} + ++ {appconf/sitelinks_name} / + {category} +
+{end if} +{if else} +{intl Please select a category}:
+ + diff --git a/inc/app/sitelinks/html/category_top.spt b/inc/app/sitelinks/html/category_top.spt new file mode 100644 index 00000000..4cb8d743 --- /dev/null +++ b/inc/app/sitelinks/html/category_top.spt @@ -0,0 +1,43 @@ +{if not empty (obj[category])} ++ {appconf/sitelinks_name} / + {category} +
+{end if} +{if else} ++ {if obj[sitesearch]} + {intl Search} + + {end if} + {if appconf ('user_submissions')} + {intl Add} {appconf/sitelinks_name_singular} + + {intl My} {appconf/sitelinks_name} + {end if} + {if appconf ('rss_links')} + + {intl Syndicated Feed (RSS)} + {end if} +
+{end if} + +{box cms/buttons/add?collection=sitelinks_item&return=[php site_prefix () _ '/index/sitelinks-app/category.' _ cgi.category]} + +{if obj[pager]} ++ {appconf/sitelinks_name} / + {category} / + {title} +
+ + {if obj.sitesearch} + {if not empty (obj.search_bar)} + {filter none}{search_bar}{end filter} + {end if} + {end if} + + {if obj.sitesearch or appconf ('user_submissions')} ++ {if obj.sitesearch} + {intl Search} + + {end if} + {if appconf ('user_submissions')} + {if session_username () eq obj.user_id} + {intl Update This} {appconf/sitelinks_name_singular} + + {end if} + {intl Add} {appconf/sitelinks_name_singular} + + {intl My} {appconf/sitelinks_name} + {end if} +
+ {end if} + +{filter none}{summary}{end filter}
+ ++ {appconf/sitelinks_name} / + {category} / + {title} +
+ + {if obj.sitesearch} + {if not empty (obj.search_bar)} + {filter none}{search_bar}{end filter} + {end if} + {end if} + + {if obj.sitesearch or appconf ('user_submissions')} ++ {if obj.sitesearch} + {intl Search} + + {end if} + {if appconf ('user_submissions')} + {if session_username () eq obj.user_id} + {intl Update This} {appconf/sitelinks_name_singular} + + {end if} + {intl Add} {appconf/sitelinks_name_singular} + + {intl My} {appconf/sitelinks_name} + {end if} +
+ {end if} + +{filter none}{summary}{end filter}
+ ++ {appconf/sitelinks_name} / + {category} / + {title} +
+ + {if obj.sitesearch} + {if not empty (obj.search_bar)} + {filter none}{search_bar}{end filter} + {end if} + {end if} + + {if obj.sitesearch or appconf ('user_submissions')} ++ {if obj.sitesearch} + {intl Search} + + {end if} + {if appconf ('user_submissions')} + {if session_username () eq obj.user_id} + {intl Update This} {appconf/sitelinks_name_singular} + + {end if} + {intl Add} {appconf/sitelinks_name_singular} + + {intl My} {appconf/sitelinks_name} + {end if} +
+ {end if} + +{filter none}{summary}{end filter}
+ ++ {intl Status}: {filter sitelinks_filter_status}{sitellite_status}{end filter} + + {intl Update} + + {intl Remove} +
+ +{filter none}{summary}{end filter}
+ +{intl Last Updated}: {filter sitelinks_filter_ts}{ts}{end filter}
++ {intl Status}: {filter sitelinks_filter_status}{sitellite_status}{end filter} + + {intl Update} + + {intl Remove} +
+ +{filter none}{summary}{end filter}
+ +
+
+ {intl Genre}: {genre}
+
+
+ {intl Last Updated}: {filter sitelinks_filter_ts}{ts}{end filter}
+
+
+
+ {intl Status}: {filter sitelinks_filter_status}{sitellite_status}{end filter} + + {intl Update} + + {intl Remove} +
+ +{filter none}{summary}{end filter}
+ +
+
+ {intl Cost}: {cost}
+
+
+ {intl Platform}: {platform}
+
+
+
+ {appconf/sitelinks_name} / + {intl My} {appconf/sitelinks_name} +
+{end if} + +{intl You have not submitted any} {filter strtolower}{appconf/sitelinks_name}{end filter} {intl yet.}
+ +{intl Add} {appconf/sitelinks_name_singular}
diff --git a/inc/app/sitelinks/html/mylinks_profile.spt b/inc/app/sitelinks/html/mylinks_profile.spt new file mode 100644 index 00000000..2360eec4 --- /dev/null +++ b/inc/app/sitelinks/html/mylinks_profile.spt @@ -0,0 +1,5 @@ ++ {appconf/sitelinks_name} / + {intl My} {appconf/sitelinks_name} +
+{end if} + +{if obj[sitesearch] or appconf ('user_submissions')} ++ {if obj[sitesearch]} + {intl Search} + + {end if} + {if appconf ('user_submissions')} + {intl Add} {appconf/sitelinks_name_singular} + {end if} +
+{end if} + +{box cms/buttons/add?collection=sitelinks_item&return=[php site_prefix () _ '/index/sitelinks-app/category.' _ cgi.category]} + + + ++ {appconf/sitelinks_name} / + {intl My} {appconf/sitelinks_name} +
+{end if} + +{if obj[sitesearch] or appconf ('user_submissions')} ++ {if obj[sitesearch]} + {intl Search} + + {end if} + {if appconf ('user_submissions')} + {intl Add} {appconf/sitelinks_name_singular} + {end if} +
+{end if} + +{box cms/buttons/add?collection=sitelinks_item&return=[php site_prefix () _ '/index/sitelinks-app/category.' _ cgi.category]} + + diff --git a/inc/app/sitelinks/html/not_registered.spt b/inc/app/sitelinks/html/not_registered.spt new file mode 100644 index 00000000..3b4cf4f0 --- /dev/null +++ b/inc/app/sitelinks/html/not_registered.spt @@ -0,0 +1,22 @@ +{if not empty (obj.username)} +{intl Invalid username or password. Please try again.}
+{end if} +{if else} +{intl If you are already a member, you may sign in here.}
+{end if} + + + + + +{intl Not a member?} {intl Click here to register.}
diff --git a/inc/app/sitelinks/html/ratings.spt b/inc/app/sitelinks/html/ratings.spt new file mode 100644 index 00000000..1bd67b17 --- /dev/null +++ b/inc/app/sitelinks/html/ratings.spt @@ -0,0 +1,34 @@ + diff --git a/inc/app/sitelinks/html/ratings_thanks.spt b/inc/app/sitelinks/html/ratings_thanks.spt new file mode 100644 index 00000000..9b6e89d4 --- /dev/null +++ b/inc/app/sitelinks/html/ratings_thanks.spt @@ -0,0 +1 @@ +{intl Your vote has been added.} {intl Click here to continue.}
diff --git a/inc/app/sitelinks/html/related.spt b/inc/app/sitelinks/html/related.spt new file mode 100644 index 00000000..6ace57ee --- /dev/null +++ b/inc/app/sitelinks/html/related.spt @@ -0,0 +1,7 @@ +{intl Your submission has been received. Please allow some time for the administrator to review your submission before it appears on our web site.}
+ +{intl Click here to continue.}
diff --git a/inc/app/sitelinks/html/summary/default.spt b/inc/app/sitelinks/html/summary/default.spt new file mode 100644 index 00000000..c159a0a1 --- /dev/null +++ b/inc/app/sitelinks/html/summary/default.spt @@ -0,0 +1,10 @@ +{filter none}{summary}{end filter}
+ +{intl Last Updated}: {filter sitelinks_filter_ts}{ts}{end filter}
+{filter none}{summary}{end filter}
+ +
+
+ {intl Genre}: {genre}
+
+
+ {intl Last Updated}: {filter sitelinks_filter_ts}{ts}{end filter}
+
+
+
{filter none}{summary}{end filter}
+ +
+
+ {intl Cost}: {cost}
+
+
+ {intl Platform}: {platform}
+
+
+
+ {appconf/sitelinks_name} / + {category} +
+{end if} +{if else} ++ {appconf/sitelinks_name} / + {filter ucwords}{type}{end filter} +
+{end if} +{if else} ++ {appconf/sitelinks_name} / + {filter ucwords}{type}{end filter} +
+{end if} +{if else} ++ {if obj[sitesearch]} + {intl Search} + + {end if} + {if appconf ('user_submissions')} + {intl Add} {appconf/sitelinks_name_singular} + + {intl My} {appconf/sitelinks_name} + {end if} + {if appconf ('rss_links')} + + {intl Syndicated Feed (RSS)} + {end if} +
+{end if} + +{box cms/buttons/add?collection=sitelinks_item&return=[php site_prefix () _ '/index/sitelinks-app/type.' _ cgi.type]} + +{if obj[pager]} ++ {intl Search} + {if appconf ('user_submissions')} + + {intl My} {appconf/sitelinks_name} + + {intl Newest Links} + {end if} + {if appconf ('user_ratings')} + + {intl Top Listings} + {end if} + + {intl Browse By Category} +
+{end if} + +{filter strtoupper}{loop/_key}{end filter}
+ {alt/reset} ++ {if loop[file] eq 'html.default.tpl'} + + {end if} + {if else} + + {end if} + | ++ {filter ucfirst}{loop/name}{end filter} + | +
+ {if loop[file] eq 'site.css'} + + {end if} + {if else} + + {end if} + | ++ {filter ucfirst}{loop/name}{end filter} + | +
+ + | ++ {filter ucfirst}{loop/file}{end filter} + | +
+ + + + | ++ + + | +
+ + + + | +
+ {intl Validate:}
+ |
+
+ + + + + + + + + + + + + + | ++ + | +
+ + + + | +
+ {intl Validate:}
+ |
+
+ + + + + + + + + + + + + + | ++ + | +
+ + + + + + | +
+ {intl Validate:}
+ |
+
+ + + + + + + | + +
+
+
|
+
+
|
+||||
+ + + + + + + | + +
+ {intl Close} +
+ +{error} ({intl Line} {err_ln}, {intl Column} + {err_cl})
diff --git a/inc/app/sitemailer2/html/tpl_validate_noerr.spt b/inc/app/sitemailer2/html/tpl_validate_noerr.spt new file mode 100644 index 00000000..f39250d6 --- /dev/null +++ b/inc/app/sitemailer2/html/tpl_validate_noerr.spt @@ -0,0 +1,3 @@ ++ {intl Close} +
diff --git a/inc/app/sitemailer2/html/view_message.spt b/inc/app/sitemailer2/html/view_message.spt new file mode 100644 index 00000000..7fc79a52 --- /dev/null +++ b/inc/app/sitemailer2/html/view_message.spt @@ -0,0 +1,49 @@ + + + + ++
{intl Subject} | +{subject} | +
{intl From} | +{fromname} <{fromemail}> | +
{intl Date} | +{date} | +
+
+
+
+
+
+
+
+ Title+ +
+ + body here + + + ++ |
+
+ Copyright
+ All rights reserved.
+