tomkinsg
Forum Replies Created
-
Forum: Plugins
In reply to: is_page within a pluginI basically gave up with this. Don’t know why i could not get it to work.
Instead I borrowed another plugin (Angsuman’s authenticated wordpress plugin) and tweaked it to do what i needed. If i get time, I will clean it up an publish it as I think it may have a broader application and I don’t think any of the other authentication plugins do authentication of a subset of a site without the need for entitlements to be set up.
thanks
GForum: Installing WordPress
In reply to: Multiple blogs, one install?!I’ve subsequently split my installations apart. Reason being there are flies in the filesystem that wordpress writes to – namely .htaccess (there maybe others). As a result, you can get errors if you are on one blog and take action that writes the .htaccess file – it can break the other blogs.
I am getting more Linux savvy so wrote a couple of scripts that help me out. I upload themes and plugins to one central master copy then run the cgi script from SSH and it deploys the themes and plugins to all the installations in one go. I also maintain a master wp-config.php for all my sites and have a simplar script that deploys it everywhere.
An alternative would have been to remove write access from .htaccess but I figured that I didn’t really like all my production web sites in one location – i was having to do too much testing when i upgraded then all in one go.
Forum: Fixing WordPress
In reply to: Permalinks break every few times I post or editI figured out my issue and it was a pure user error.
I was running multiple sites out of the one installation – it works pretty well but if the .htaccess file is updated from one blog, it has the opportunity to mess up your others.
I could have set all up the same and taken away the write access to .htaccess but i tried a different approach instead and am quite liking the results.
I’ve split my different sites up to use several different installations. Er – not rocket science! Sure the overhead is a little higher on maintenance but actually i am finding it better to be separated because when i upgrade i ont put all my sites at risk. I can upgrade the less important first, test the upgrade process and do each of my important sites in turn. Much more controlled. I can do this because I have SSH access to my ISP server and I’m getting more linux savvy as each week passes. Now I have written a couple of cgi scripts that I can use to deploy themes and plugins to all sites from one master copy and also to keep my master wp-config.php file in sync across the site. I just have an extra step each time i upload a plugin or theme – no big deal really.
I just upgraded 10 sites to WP 2.3.3 and really it was a breeze.
Forum: Fixing WordPress
In reply to: Permalinks break every few times I post or editI was thinking on this today and that this is perhaps caused by a plug in. These are the plug ins that i have activated
Akismet 2.1.3
Easy Tube 0.2.2
Front Page Excluded Categories 1.1.1
Gravatar 1.1
Group Restriction 1.0
runPHP 2.3.1
Sort Categories By Title 1.0
Upcoming Events 0.5
WP-Cron-Mail 1.2
WPG2 3.0.2Any in common with those others that are experiencing on this.
Forum: Fixing WordPress
In reply to: Permalinks break every few times I post or editI am also getting this problem on my site – i have multiple contributors so it is a little hard for me to pinpoint the exact cause but this is a little frustrating. I am on the latest release – 2.3.2.
Forum: Installing WordPress
In reply to: Issue sorting posts by titleOK … i just figured this out through playing with other people’s blogs.
The issue is that I have “Sticky” plug in activated and it stops all attempts at putting orderby=… in the url, in the theme or anywhere.
I’ll report it to the author.
thanks
GlynForum: Installing WordPress
In reply to: Issue sorting posts by titleanyone any ideas on this? I still have not got this working and I have followed the example in the codex on alphabetising the list to the letter but it doesn’t work. I am using latest WP – 2.3.1
neither of these two links alphabetises by title:
http://www.tarheeldiving.com/?cat=17&orderby=title&order=asc
http://www.tarheeldiving.com/?cat=29&orderby=title&order=ascthanks
GlynForum: Installing WordPress
In reply to: Multiple blogs, one install?!It is possible to have multiple sites serviced from a single wordpress installation and it is very easy to do.
i find it very desirable – makes life a lot lot easier. You just have to be careful when upgrading since you are upgrading multiple sites in one go, but that is pretty easy to accomplish if you give it some thought, get a solid backup and test your deployment process.
The simplest way is a switch in wp-config.php that sets the $table_prefix based on, in this case, the domain name. This is an example …
switch ($_SERVER[‘HTTP_HOST’]) {
case “www.mydomain1.com”:
case “www.mydomain2.com”:
case “subdomain.mydomain2.com”:
$table_prefix = ereg_replace(‘^(www\.)’, ”, $_SERVER[‘HTTP_HOST’]);
$table_prefix = ereg_replace(‘\.’, ”, $table_prefix);
$table_prefix = $table_prefix . ‘_’;
break;
default:
$table_prefix = “default_’;
}change the domain and also change the prefix for the default.
the use of the switch and the entering of the list of domains ensures that no domain other than your domains can be directed to and use your wordpress installation. Otherwise i dread to think what some maliciously minded person could do with your sites. 🙂
hope this helps
GlynForum: Fixing WordPress
In reply to: Get Parent Page link from Child PageI got this to work without an issue. I am on WP 2.2. I wanted to have a menu with a submenu and when you are on the submenu page i wanted it to continue to show the submenu items … ie the current page and its peers … I also highlight the menu item and the submenu item that you are on.
It’s got a limitation in that every page has to be on the menu or submenu for it to work. I am sure though that there is an easy enough bit of logic that could be added to address this.
Here is what i have in my header.php
<div id="header"> <ul id="nav"> <?php $mainID = 3; /* set this to the parent of your menu items */ wp_list_pages('child_of='.$mainID.'&sort_column=menu_order&depth=1&title_li='); ?> </ul> <div class="hr"><hr /></div> <ul id="nav"> <?php /* get the parent ID */ if ($post->post_parent != 0) { $parentID = $post->post_parent; } if ($parentID != $mainID) { /* we are not on a main menu page grab this page's siblings */ /* this does assume that all pages are menu or submenu items */ $submenuparentID = $parentID; } else { /* we are on a main menu page so grab this page's children */ $submenuparentID = $post->ID; } wp_list_pages('child_of='.$submenuparentID.'&sort_column=menu_order&depth=1&title_li='); ?> </ul> </div> <!-- #header -->Forum: Fixing WordPress
In reply to: including an external formOK … I pursued my third idea here and made it work neatly using standard WordPress function.
I made two new page templates in my style – one i called preURL and the other I called postURL. They are a little odd. My standard page template looked like this:
<?php get_header(); ?> <!-- content ................................. --> <div id="content"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php if (substr(the_title('','',false),0,1) != "*") { ?> <h2><?php the_title(); ?></h2> <?php } ?> <?php the_content(); ?> <?php endwhile; ?> <?php endif; ?> </div> <!-- /content --> <?php get_sidebar(); ?> <?php get_footer(); ?>This is what my preURL template looked like:
<?php /* Template Name: preURL */ ?> <?php get_header(); ?>and the postURL template:
<?php /* Template Name: postURL */?> <?php get_sidebar(); ?> <?php get_footer(); ?>I then created two pages, one using the preURL template and the other the postURL template and from my site with the form, I added code there that included these two pages before and after my content.
Neat solution using the standard features of WordPress.
Gotta love WordPress.
G
Forum: Installing WordPress
In reply to: $_server (script uri, query string, etc) – unable to retieveI have a similar issue to this … I have my print_r within a post using RunPHP.
In my case i can see the output of the print_r shows that query_string is null even though my URI that i called the page with includes a query string. lots of the other values are being returned.
My URI: http://localhost/wordpress/blog/category/sidebar/register/?var=value
result of the print_r:
Array
(
[HTTP_HOST] => localhost
[PATH] => C:\Program Files\Windows Resource Kits\Tools\;C:\Program Files\ThinkPad\Utilities;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\IBM\Infoprint Select;C:\Notes;C:\Program Files\XLView;C:\lotus\compnent;C:\Utilities;C:\Program Files\IBM\Personal Communications\;C:\Program Files\IBM\Trace Facility\;C:\Program Files\ThinkPad\ConnectUtilities;C:\WINDOWS\Downloaded Program Files;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\ATI Technologies\ATI Control Panel
[SystemRoot] => C:\WINDOWS
[COMSPEC] => C:\WINDOWS\system32\cmd.exe
[PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
[WINDIR] => C:\WINDOWS
[SERVER_SIGNATURE] =>
Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_autoindex_color PHP/5.1.6 Server at localhost Port 80[SERVER_SOFTWARE] => Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_autoindex_color PHP/5.1.6
[SERVER_NAME] => localhost
[SERVER_ADDR] => 127.0.0.1
[SERVER_PORT] => 80
[REMOTE_ADDR] => 127.0.0.1
[DOCUMENT_ROOT] => C:/xampplite/htdocs
[SERVER_ADMIN] => admin@localhost
[SCRIPT_FILENAME] => C:/xampplite/htdocs/register.php
[REMOTE_PORT] => 4340
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.0
[REQUEST_METHOD] => GET
[QUERY_STRING] =>
[REQUEST_URI] => /register.php
[SCRIPT_NAME] => /register.php
[PHP_SELF] => /register.php
[REQUEST_TIME] => 1160425108
[argv] => Array
(
)[argc] => 0
)in the header.php in my theme, i can see the var=value but in the page template page.php, the value is cleared.
suggestions appreciateed. thanks
GlynThanks Otto … I only have the one form so putting it into a specific page template would likely work quite simply for me.
thanks Glyn
Forum: Themes and Templates
In reply to: Getting the page template name.. well i persevered. I don’t know if this is the most elegant method but this is what i have done:
1. I created a function called
get_page_template_name()based onget_page_template()out offunctions.php.it returns the file name (without the full path and without the .php extension) of the template in use. e.g. if i have templates called MyTemplate.php and YourTemplate.php – it will return MyTemplate or YourTemplate respectively.
function get_page_template_name() {
global $wp_query;
$id = $wp_query->post->ID;
$template = get_post_meta($id, '_wp_page_template', true);
$template = substr($template,0,strlen($template)-4);
return apply_filters('page_template', $template);
}
2. I created n new templates that i can select when creating pages. In this case
MyTemplate.phpandYourTemplate.php3. In my
header.phpthat is used in all templates, I have this:
<div id="header" <?php if (get_page_template_name()!="") echo "class=\"".get_page_template_name()."\"";?>>
so it adds a
class="MyTemplate"or aclass="YourTemplate"or noclassattribute at all.4. In my CSS, I have added some additional classes as needed:
#header.MyTemplate {
background-image:url(/wordpress/images/top/MyTemplate.jpg);
}
#header.YourTemplate {
background-image:url(/wordpress/images/top/YourTemplate.jpg);
}
I hope this is useful for others. I would be interested to know if there is a more elegant way of doing ths.
regards
GlynForum: Themes and Templates
In reply to: a little advice …wow … wordpress is so easy to move.
here’s the site out there:
http://www.theairwaysite.com/wordpress/
thanks
glynForum: Themes and Templates
In reply to: a little advice …Spencer, i feared that you might ask that … I have it only installed on my PC at home. sorry for also for lackof clarity on teh question. It’s late!!!!
I’m in the process ofputting the ste up on a server .. will post again with the url when it is there.