All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - frisco

Pages: [1] 2 3
1
WP-PageNavi / Re: WP-Pagenavi with static front page
« on: 10 November 2008, 17:24 »
I never saw a link ending in /page/1 or /page/1/ even before I modified wp-pagenavi.php.  I only saw 2 links: http://www.qbgarage.com/ and http://www.qbgarage.com/page/2/.

In the initial tests I did, I only have 2 pages of posts (if I set my max posts low enough), the link for page 1 was the same as the link for the <<.  With my mod, now both links have the index.php tacked on. 

I just experimented with my max posts setting in pagenavi and the WP # of posts to display.  I didn't change any of the link texts for pagenavi.  I have 10 posts.  I set pagenavi to show a max of 2 pages, and WP to show a max of 3 posts.  Some of these posts are private, if that matters.

When I do this, pagenavi correctly shows that I have 4 pages, but the << link is just that, not << First.  The >> link I would expect to show as /page/3/, but it doesn't - it shows as /page/2/.  Clicking Last >> does take me to the last page, /page/4/, and now I see a link to /page/3/.  When I do that I see in this order: Page 4 of 4, an empty box that is a link to my home page + index.php, an unlinked box with ..., a linked << to my home page + index.php, a link to /page/3/, and the current page which is 4.  That sequence doesn't seem right to me.  It's as if pagenavi is ignoring the Text for First Post setting.  I'll leave it that way for a day or so if you want to see what I mean.  I don't think the mod's I made have anything to do with that behavior.

Btw, my "blog" is on the Shop Talk menu choice from the home page, or the home page + index.php

2
WP-PageNavi / Re: WP-Pagenavi with static front page
« on: 10 November 2008, 15:15 »
Thanks for the thought on re-write rules.  I don't want to redirect every link, just the ones that come out of pagenavi.  For pages 2 and beyond, pagenavi works fine.  Without any modification, pagenavi produces these links:

First: http://www.qbgarage.com/
Page 1: http://www.qbgarage.com/
Page 2: http://www.qbgarage.com/page/2/

What I want:

First: http://www.qbgarage.com/index.php
Page 1: http://www.qbgarage.com/index.php
Page 2: http://www.qbgarage.com/page/2/

Note that there is no change for page 2.  All I am doing is adding index.php to Page 1 and First.  I'm guessing that pagenavi only shows the link to First when there are more than the max # of pages to display, and I don't have that many posts so I haven't seen that yet.  I guess that is what #3 in my change addressed.  The links to my pages are in the form of http://www.qbgarage.com/somepage, and to posts in the form of http://www.qbgarage.com/somecategory/somepostname.  I don't want to insert index.php in any of that, which all works fine.  Also, keep in mind that although I do have a static front page, I do not have my WP reading setting to display a static front page; that setting is to display a page of posts.  I've just created my own static front page by having an index.php that checks to see if it's the front page and then shows posts in certain categories, and if it's not the front page it does a normal loop with but excludes those categories shown on the front page.  So my front page is static in a sense, but I can change it by changing what posts are in the category.  I think I've created a bit of confusion by calling what I have a "static front page." 

Do you think my solution - which does work - is the best solution now that I've cleared up what I'm doing?

3
WP-PageNavi / Re: WP-Pagenavi with static front page
« on: 09 November 2008, 23:00 »
Well, I got it to work! Keep in mind I'm just trying to paginate my index.php.  Here's what I did:

I made these changes to wp-pagenavi.php

#1 where you find this line:

previous_posts_link($pagenavi_options['prev_text']);

Replace it with:

if ( clean_url(get_pagenum_link()) == "http://www.qbgarage.com/" ) {
  echo '<a href="'.clean_url(get_pagenum_link()).'index.php'.'" title="'.$page_text.'">'.$pagenavi_options['prev_text'].'</a>';
} else {
  previous_posts_link($pagenavi_options['prev_text']);
}

#2 where you find this line:

echo '<a href="'.clean_url(get_pagenum_link($i)).'" title="'.$page_text.'">'.$page_text.'</a>';

Replace it with:

if ( clean_url(get_pagenum_link($i)) == "http://www.qbgarage.com/" ) {
  echo '<a href="'.clean_url(get_pagenum_link($i)).'index.php'.'" title="'.$page_text.'">'.$page_text.'</a>';
} else {
  echo '<a href="'.clean_url(get_pagenum_link($i)).'" title="'.$page_text.'">'.$page_text.'</a>';
}

#3 Where you find this line...(which comes first in the wp-pagenavi.php file...)

echo '<a href="'.clean_url(get_pagenum_link()).'" title="'.$first_page_text.'">'.$first_page_text.'</a>';

Replace it with:

if ( clean_url(get_pagenum_link()) == "http://www.qbgarage.com/" ) {
  echo '<a href="'.clean_url(get_pagenum_link()).'index.php'.'" title="'.$page_text.'">'.$page_text.'</a>';
} else {
  echo '<a href="'.clean_url(get_pagenum_link()).'" title="'.$first_page_text.'">'.$first_page_text.'</a>';
}

Obviously, this is just hard-coded for my URL, but you get the picture.  I am not entirely sure that #3 is necessary because it wasn't clear to me when that link was created.  But what I did was to check the value returned by get_pagenum_link() and if it was the same as the blog address, just tack on index.php.  I made no modifications to get_pagenum_link() which is in wp-includes/link-template.php in case anyone is looking for it.

What do you think?

4
WP-PageNavi / Re: WP-Pagenavi with static front page
« on: 09 November 2008, 15:19 »
I'm not doing a static front page using the standard WP technique.  I do have a page of posts.  Looking at WP-Pagenavi, it seems to set page 1 to the blog address by using a WP function.

If you give me a suggestion on how to change in the WP-Pagenavi code that blog address from the result of the WP function to something with index.php tacked on the end, that will work fine. 

Maybe I'm not phrasing my question correctly.  Does that make sense?

5
WP-PageNavi / WP-Pagenavi with static front page
« on: 09 November 2008, 04:16 »
Hopefully you can point me in the right direction to fix this problem.  My website is www.qbgarage.com running WP 2.6.3

In WP settings, my blog address (URL) is http://www.qbgarage.com and I have a static front page.  I have a hard-coded link to my blog on my main menu to http://www.qbgarage.com/index.php.  Everything works fine, except pagenavi.  Pagenavi sets the link to page 1 as my blog address, or just http://www.qbgarage.com.

I'm not sure if you can see this, because I don't have that many posts.

If I change my blog address to http://www.qbgarage.com/index.php in WP settings, pagenavi works fine.  But this approach adds index.php to the permalink for all my posts/pages, which redirect fine, but just look very strange.  So what I want to do is reset my blog address (or whatever variable is used for page 1) in pagenavi to http://www.qbgarage.com/index.php.  That way pagenavi will return to my blog and not my home page. 

Any suggestion on how I can do that?  Thanks in advance.

6
Ok, I deactivated/re-downloaded/re-activated.  However, I really don't want to reset the bans so I really can't test whether the total works.  The total now is different than before (probably had a few bans), but it is still very small compared to the list of bans made.  It is showing 12 bans now when the list shows about 2000 bans.  I'm guessing the 12 is just the bans since wp-ban 1.3 was installed? 

Not a big deal, but ideally the list of bans previously made should either a) be converted into the new ban table or b) (simpler?) split the list into bans previously made and a second group of bans recorded in db (which appears to be what is totalled).

I forget to mention, many thanks for the user agent ban.  This is a great tool for banning just 1 person who shows up in a range of IPs when you really don't want to ban that IP range.  Great work.

7
WP-Ban / Re: Banning proxies
« on: 03 June 2008, 02:06 »
ok, i'm happy to test it.  if you can post the mods here, or email it to me, i'll post the results.

8
WP-Ban / After upgrading to WP-Ban 1.30, wrong total shown
« on: 02 June 2008, 16:01 »
Had a WP 2.5.1 blog running WP-Ban 1.20 just fine.  Probably had close to 2000 bans that WP-Ban made.  After upgrading, all the bans made are still listed, but the sum of all the bans is displayed as "7", which is clearly wrong.  Just a handful of rows in the list of bans made add up to more than 7.

Is WP-Ban 1.30 just reporting the bans made since 1.30 was installed?  Is it just a math or display error?  Did I do something wrong?

9
WP-Ban / Re: Banning proxies
« on: 02 June 2008, 15:51 »
I think the testing would involve something like this: for wp-usersonline, show the HTTP_X_FORWARDED_FOR value.  You could just describe this as a patch to usersonline here. 

Based on the post I saw elsewhere, if there is no proxy (the user is on his own IP), that will have no value.  If he is on a proxy, the value will be his own real IP.  Let's say on a beta version of wp-ban, you put in a flag to ban proxies or not.  If the flag is set, it does the banning but can be stopped if it doesn't work.  People can use the combination of wp-usersonline to see if regular users on their own IP are having a value set (which would mean this won't work exactly as described) + the setting in wp-ban to try.  Users that want this will tell you pretty quickly if it is just banning proxies or banning legitimate users.

Another way not involving wp-useronline would involve displaying the banned IP and the value of HTTP_X_FORWARDED_FOR in the list of bans that wp-ban made.  Someone could turn on the "ban proxies ?" flag, and see what happens to bans and the values that show up in that list. 

It all comes down to doing some real world testing on a mod'd/beta version to see if it is true that HTTP_X_FORWARDED_FOR is only set when a proxy server is used and being able to turn off the feature if it is not working.  I'd be willing to manually modify wp-ban and test it if you do the code.  I don't even need the UI to set the ban proxies flag, as long as I can change it in the code.

10
WP-Ban / Re: Banning proxies
« on: 01 June 2008, 21:34 »
If by ISP proxy, you mean a CGI proxy, I think you are correct.  Other than the user agent issue, what do you think of adding an optional proxy server ban to wp-ban.  It's been mentioned a few times here.

11
WP-Ban / Banning proxies
« on: 01 June 2008, 19:13 »
I came across this little bit of code as a solution to ban users visiting from a proxy server.  The reasoning was that people who don't use proxies have no http_x_forwaded_for setting.  Developer claimed that check for user agent s because most DDoSing programs don't have a User-Agent attribute where as all internet browsers do.

Code: [Select]
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) || ($_SERVER['HTTP_USER_AGENT']=='') || ($_SERVER['HTTP_VIA']!='')){
        die("Don't use proxies, please.");
}

Would this work?  Maybe add a switch to wp-ban to ban proxies or not?

12
WP-Print / Undefined function add_shortcode()
« on: 30 March 2008, 23:54 »
Are the Beta 2 versions of the plugins only compatible with WP 2.5?  I ask because I tried to install wp-print 2.30 b2 on WP 2.3.3 and got this error.

Fatal error: Call to undefined function add_shortcode() in .../wp-content/plugins/wp-print/wp-print.php on line 177

Is this a core WP function?  Or does it come from another of your plugins?  This was the 1st of yours that I tried to upgrade.

Thanks.

13
WP-Polls / Re: Oddity after upgrading to latest version
« on: 30 December 2007, 21:31 »
Hmmm...went to check and can't say for sure...I probably had the most recent version before your recent Oct upgrade that required WP 2.3.

In thinking about this, I think a better programming approach would be to set a default for 'style' and then get the choice the user made in Polls Options.  That way you trap for the error of style not being set and you don't have to worry about prior versions or upgrade instructions.

14
WP-Polls / Oddity after upgrading to latest version
« on: 28 December 2007, 23:13 »
Lester, I came across this little oddity after upgrading to WP 2.3.1 & the latest version of WP-Polls.  After I upgraded and activated the plugin, I didn't visit Polls Options and check settings.  There was no selection for Poll Bar Style.  Therefore, since there was no style, code like this ...

Code: [Select]
echo "\t".'background-image: url(\''.get_option('siteurl').'/wp-content/plugins/polls/images/'.$pollbar['style'].'/pollbg.gif\');'."\n";

generated an effort to get this image ...

Code: [Select]
.../plugins/polls/images//pollbg.gif and
Note the double //'s.  I went to Polls Options, made a choice for Poll Bar Style, deactivated, reactivated, and the bad link was gone.  It's not so much a problem with the plugin as adding this to the upgrade instructions.  Then again, it could be user error. ;D

15
WP-Ban / Re: Feature suggestions
« on: 18 December 2007, 22:57 »
Let me also echo the support for integrating Akismet to WP Ban.  The other thing that Ban needs is an ability to remark why something is banned.  I'm developing an extensive list of banned IP's that have hit our site, and it is impossible to remember why someone was banned.  The new phpBB3 has something similar, and also allows for permanent or time-based bans (like 1 day, 1 week, etc.)  That would be good too.

16
WP-PostRatings / Re: Problem doing first rating
« on: 18 December 2007, 22:53 »
Yes, I thought I stated that earlier.  When you say snippet_chars(), I assume you are referring to the version you last posted in this thread.  The version of snippet_chars() that's in the download as of when I first brought this up does NOT work.

The other thing is that because of the way ' is represented, I do lose 6 characters with both the new snippet_chars() and snippet_text().  Unless there are other reasons for you to keep 1 or the other, I'd use whichever of these 2 are fastest.  Obviously, there's no need for both functions.

Thanks! 

17
WP-PostRatings / Re: Problem doing first rating
« on: 18 December 2007, 04:52 »
Lester, for post titles with an ' in them, this function works like the snippet_text(), in that with my parameters it shows 22 characters except for posts with characters like an ', where it displays 6 fewer characters than the amount I specified.  I had 1 ' character, which translated into 7, and 7-1=6.  I'm guessing that if I had 2 ' characters, it would display 12 fewer etc.

So, the snippet_chars() in the plugin now doesn't deal with ', but both snippet_text() and this latest snippet_chars() produce the same result for me.

18
WP-PostRatings / Re: Problem doing first rating
« on: 16 December 2007, 20:49 »
You are absolutely right.  The ' was being converted to &#8217; (7 characters) by preg_split() used in snippet_text().  Thanks for the help.

19
WP-PostRatings / Re: Problem doing first rating
« on: 16 December 2007, 18:08 »
We're getting closer!  In the current version of the plugin, you use a function called snippet_chars().  In a previous version, you used something similar with a different name: snippet_text().  The functions do the same thing, but using different underlying functions.  That's where the difference comes from.

Here's snippet_chars() - note that the name is wrong:

Code: [Select]
### Function: Snippet Text
if(!function_exists('snippet_chars')) {
function snippet_chars($text, $length = 0) {
$text = htmlspecialchars_decode($text);
if (strlen($text) > $length){       
return htmlspecialchars(substr($text,0,$length)).'...';             
} else {
return htmlspecialchars($text);
}
}
}

Here's snippet_text():

Code: [Select]
### Function: snippet_text
if(!function_exists('snippet_text')) {
   function snippet_text($text, $length = 0) {
      $words = preg_split('/\s+/', ltrim($text), $length + 1);
      if(count($words) > $length) {
         return rtrim(substr($text, 0, strlen($text) - strlen(end($words)))).' ...';
      } else {
         return rtrim(substr($text,0,$length)).' ...';
      }
   }
}

When I replace the call to snippet_chars() to snippet_text() in the get_highest_rated() call in my sidebar, the problem of displaying the ' properly is fixed.

Right now, I have both snippet_chars() and snippet_text() in postratings.php.

One other odd thing on this, though.  My call to get_highest_rated() is to display 10 posts with 22 chars of the post title.  8 of the post titles display 22 chars.  I have 2 post titles ("It's Time For Answers" and "It's Not Our Problem Anymore").  Both of these are cut off at 16 chars (as in "It's Time For An" and "It's Not Our Pro").  They're # 7 & 8 in the list, so titles before & after them display correctly.  Isn't that weird?  Any thoughts?

20
WP-PostRatings / Re: Problem doing first rating
« on: 16 December 2007, 15:44 »
Lester, the thing that is confusing is that in the previous version of postratings running under the previous version of WP, I had $chars = 22 and it did accurately produce a post title with a ' in it.  I think you used snippet_chars in that one also.  So to me, the upgrade introduced the change in the way snippet_chars() worked.  I haved looked back at the underlying code of that function and what calls it uses, but I think that is where the answer is.

Pages: [1] 2 3