Archive for the ‘ Wordpress ’ Category
There are three components to the system:
The first thing we need to do is build the form using the “WordPress Form Manager” plugin.
We create a form with the following fields: “Company name”, “Document title” and “Select document”. We also add a note field to display additional information about accepted file formats and file size, etc. Pay attention to the upload document section as to restrict the document types.
We also add a “Private Field” at the bottom of the “Form extra” tab. This is what our administrator will use to approve each press release.
Once you have created the form, add it to the exhibitor upload page with the following shortcode format:
[form form-XYZ]
We include a simple PHP script into the WordPress page to pull data off the database. The code I used can be obtained here.
To summarise, the script will need to be modified in the following places:
The administrator logs into WordPress and navigates to the Submission Data tab of the form being used.
Using the checkboxes and the “Edit selected” function from the dropdown list of actions, the admin can edit…

and approve each press release.

We use the plugin Exclude Pages to show or hide pages in the navigation of our WordPress sites.

It’s very useful, but if you suddenly need to show or hide a lot of pages, it becomes tedious and a waste of time to do it through the WordPress backend.
That’s why I looked at how to bulk edit this in the database directly. Start by locating the correct table in MySQL:
Then add or remove page ids as needed. (Note: The numbers that appear here are the pages that are hidden from the user)
UPDATE wp_posts SET comment_status = 'closed'; UPDATE wp_posts SET ping_status = 'closed';
UPDATE wp_posts SET ping_status = 'closed' WHERE post_type = 'post|page';
UPDATE wp_posts SET ping_status = 'closed' WHERE post_status = 'publish|inherit|pending|private|future|draft|trash' AND post_type = 'post';
Here’s how to include the EWEA navigation file in templates for microsites:
<div id="navigation">
<?php
// INCLUDE EWEA MENU
$naviURL = "http://www.ewea.org/navigation-file/";
if ($fh = fopen($naviURL,"r")) {
fpassthru($fh);
} else {
echo "<p>Unable to load menu.</p>\n";
}
?>
</div><!-- end #navigation -->
I have installed the WordPress plugin “Google Analyticator” on all the WordPress-based websites.
However, for those that have the “EWEA Master Code” installed, I needed to edit the plugin code.
<script type="text/javascript">
var _gaq = _gaq || [];
// This website code here:
_gaq.push(['_setAccount', '<?php echo $uid; ?>']);
<?php if ($need_to_annon == '1' ): ?>
_gaq.push(['_gat._anonymizeIp']);
<?php endif; ?>
<?php
# Add any tracking code before the trackPageview
do_action('google_analyticator_extra_js_before');
if ( '' != $extra )
echo "$extra\n";
# Add the track pageview function
echo "_gaq.push(['_trackPageview']);\n\n";
# Disable page tracking if admin is logged in
if ( ( get_option(key_ga_admin) == ga_disabled ) && ( ga_current_user_is(get_option(key_ga_admin_role)) ) )
echo "_gaq.push(['_setCustomVar', 'admin']);\n";
# Add any tracking code after the trackPageview
do_action('google_analyticator_extra_js_after');
if ( '' != $extra_after )
echo "$extra_after\n";
# Add the final section of the tracking code
?>
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
Now we add the EWEA Master Code in the plugin settings area:

For copying/pasting:
// EWEA's master code here: _gaq.push(['_setAccount', 'UA-4609386-40']); _gaq.push(["_setDomainName", "none"]); _gaq.push(["_setAllowLinker", true]); _gaq.push(["_trackPageview"]);
This is what I implemented on EWEA OFFSHORE 2013 Video Archive page:
http://wordpress.org/extend/plugins/youtube-channel-gallery/
http://www.ewea.org/offshore2013/media-and-press/video-archive/
[nggallery id=1 template=galleryview images=0]