Webmastersite.net

Search    Register    Log In   


By on Jul 29, 2015 at 2:32 PM (Edited Jul 29, 2015 at 2:35 PM)

A while back, I added some automatic file extension correction code that fixed the extension for files that were named incorrectly. If somebody named a png file as my.jpg, WSN detects that it's actually a png and renames it to my.png so that thumbnails etc work correctly.

Turns out there was an unexpected problem with this. It works fine with images, but other file types have MIME values which can't easily be matched to a file extension. MP3 files can have a MIME type audio/mpeg or x-wav, so WSN was renaming them with .mpeg or .x-wav extensions. The next release of all the active series fixes this problem by restrincting the MIME renaming to only a small whitelisted selection of detected MIME types: JPEG, GIF and PNG files.

Also fixed a 9.1/9.2 bug that was causing files to download with the wrong file name.


By on Jul 17, 2015 at 6:03 AM

Big changes in WSN Gallery yesterday. Youtube has completely dropped support for RSS feeds and hasn't introduced any equivalent searching mechanism in their much more restrictive api v3. Since youtube isn't playing ball and I'm unable to find any workarounds or third parties to generate youtube feeds, I've changed the feed focus over to flickr. WSN Gallery can now take a flickr search term from the submit feed page instead of a youtube search term. Unfortunate to have to make the change, but hopefully flickr will prove useful to someone, as they seem committed to their feeds.

Suppose you wanted to make a gallery site of animal photos. All you need to do now is create a category for each animal. In the cats category, submit a feed and use the search term (actually flickr tag) "
cats" and you'll get new cats automatically appearing every day. It's that easy.

Also fixed a template issue in WSN Gallery which was causing the columns to not align properly.


By on Jul 08, 2015 at 12:14 PM (Edited Jul 08, 2015 at 4:02 PM)

A few days ago, all of my WSN installations stopped being able to update themselves. At first I thought something was wrong with the tar extraction code as it was only extracting the folder and not any of the files in it. After a few hours of testing I discovered that the problem was wider than that, and in fact any script-created directory was being created with 600 permissions which make it impossible to write any files to it. Worse yet, script-created files were also created as 600 which causes them to show up as 403 forbidden errors on the web. This included the javascriptheader.js file, so all javascript was broken, impairing functionality considerably.

My web host, Liquid Web, is oblivious to the fact that things never worked this way before and suggests setting a umask in the script. For the sake of anyone else on a web host with bad defaults (so far I've only seen it happen on liquid web), I've set a umask(022) in the latest release of the four active series. This umask value causes the default permissions to be 755 for directories and 644 for files. Since the PHP manual entry for umask warns that it's not reliable on multithreaded webservers, I've also added CHMODs after file and directory creation to be extra sure the right permissions are set in all server configurations.

Unfortunately, if you're on Liquid Web and already affected by this (not sure if it affects all their clients), you'll have to manually open includes/prestart.php and add umask(022); right after the <?php at the top in order to be able to run an automatic update. There's nothing I can do to help that, except to offer to make that change for you manually if you contact me, since it's the old version that has to download and extract the tar.


By on Jul 03, 2015 at 11:43 PM

I've been giving the link checker utilities some long-overdue attention. Lots of code cleanup there. Instead of awkward top of page output, it now uses the regular redirect page. The interface is visually simplified, output is shown automatically but no action is taken until it brings you to the suspects page at the end (except for the duplicate checker). The suspects page is now a separate template instead of being kludged into the link checkers template. Duplicate titles are finally handled correctly. And there's a new option to demote failed reciprocators to regular listings, for sites where that's applicable. Unsuspending listings is now checkboxably easy too.

Take a look at these changes in 9.2.8 and 9.1.40 when they're out in a few days. They should make the link checking experience much less painful.


By on Jul 02, 2015 at 9:55 AM

You might want your footer to stick to the bottom of the page when the page content is short (so that there's empty space in the middle but no empty space below the footer), while still allowing the footer to go down below the fold on long pages. If you know the fixed pixel height you want your footer to be (200px works well for the default footer) then here's a method for you.

First, in the wrapper template, add <div id="pagewrapper"> just below <body> and add </div> just above </body>. Then in the stylesheet add this:

#pagewrapper
{
min-height:100%;
position:relative;
}

.main
{
padding-bottom: 200px;
}

footer
{
height: 200px;
width: 100%;
padding: 0;
margin: 0;
position:absolute;
bottom:0;
left: 0;
}

Your footer is now sticking to the bottom on short pages.


By on Jun 23, 2015 at 12:08 PM (Edited Jun 23, 2015 at 12:09 PM)

In recent days one of the things I've been working on is loadable data sets. I found a free source with ~400 business types organized into categories and subcategories, and I've added that as an option in the WSN Directory installer. I'm also using that to generate a dataset of the same categories as 3rd and 4th level subscategories beneath USA states and Canadian provinces (e.g. Canada -> Ontario -> Finance -> Insurance).

What other datasets might be useful?


By on Jun 17, 2015 at 3:55 PM

Sometimes you may want to incorporate a new page into a sub-wrapped area like the member home or the moderator control panel. In the past, you might've done that by linking to the new page as profile.php?TID=x to make it appear as part of the member home with the member home menu present. This is problematic if you're trying to incorporate a standard template though, like the help section. If you wanted to make the help section part of the member home, you might've decided to just copy the member home subwrapper content directly into the help templates -- making your site hard to maintain.

Now there's a solution:
<!-- usesubwrapper=homesubwrapper.tpl -->

This works the same as the long-existing <!-- usewrapper=customwrapper.tpl --> syntax that was used for defining a custom wrapper inside the template instead of inside the URL. Now you can do it with subwrappers too. Just put <!-- usesubwrapper=homesubwrapper.tpl --> anywhere inside a template and that template will become part of the member home area.


By on Jun 11, 2015 at 5:47 PM

By default, the option for visitors to reassign a listing has been showing up for members on both the submit listing and edit listing pages. I feel this can be confusing on the submit listing page and people may end up generating new accounts and assigning listings to them when they don't read carefully. I can't think of any reason by a non-admin would want to reassign a listing during the submission process -- an admin would want to, and a member might want to reassign later when they sell a site but not during submit. So, to limit potential confusion, I'm changing it so that non-admin members only see the reassignment option on the edit listing page -- not on the submit listing page. This change is in the next release of 9.1 and 9.2.


By on Jun 08, 2015 at 8:35 AM

In the last few days: Changed WSN Forum's category names to use <h2> tags for better SEO. Converted the registration defaults to use a serialized array instead of the previous custom format, and added a helper function for changing a registration default. Did a lot of code refactoring for 9.2. Improved the details of parameters in backtraces in bug reports.

Made a lot of progress on the ability for the upgrader to update templates and styles from a theme instead of from the standard. Hopefully this will be finished for 9.2.1. After it's finished I'm hoping to incorporate simple theme selection (with just the best themes shown) into the installer, instead of the guided start. Then at some point I'll try to incorporate bootswatch to let people visually choose the coloring for bootstrap themes.


By on Jun 04, 2015 at 6:42 PM (Edited Jun 04, 2015 at 6:51 PM)

Found a nice tool called browsera for detecting javascript errors and layout problems that are specific to Internet Explorer.

Most of the time, WSN's template conditionals make things easy. There's a long-standing annoying case where they're buggy, though: checking whether a complex HTML field contains a term. Suppose you want to do <IF {LINKDESCRIPTION} contains widget>This listing mentions a widget</IF>. If the description has HTML tags, the conditional can error because the closing tags in the HTML are taken as closing the conditional. Worse yet, if you've enabled search highlighting even simple text can become HTML on the search results page. When someone searches for widget, 'widget' is replaced on the page with <span class="searchhighlight">widget</span> in order to highlight the searched word and this causes the same HTML comparison problem. One workaround for that is to exclude any fields you compare that way from search highlighting, but that's not ideal and it's hard to notice and catch the problem.

In order to have a safer way to do these sorts of comparisons, I'm introducing an optional new syntax {LINKVARCOMPARE[description <,> contains <,> text]}. You'll be able to safely write the conditional as <IF {LINKVARCOMPARE[description <,> contains <,> widget]}>. The first parameter is the template variable name, the second parameter is the operator, the third is the needle. The operators names are the same as in the conditionals syntax: is, is not, contains, does not contain, greater than and less than.

This new syntax will be available soon in both 9.1 and 9.2.
<< February 2019 >>
SunMonTueWedThuFriSat
12
3456789
10111213141516
17181920212223
2425262728

Recent Comments