Webmastersite.net

Search    Register    Log In   


By on Dec 09, 2018 at 9:24 PM (Edited Dec 09, 2018 at 10:34 PM)

Today, I've been working mostly on updating the WSN KB blog theme. That's the theme this blog is based on.

The main change I wanted to make was to add a simple subscription button. It's much better for a blog to have a button to click on the front page for members to subscribe to email notifications of all new blog entries, instead of expecting people to edit their profile and set "Notify of all new blogs" to "yes". To do this I had to change the backend to make it possible to subscribe with a click. And then it seemed like a good idea to have the button available to guests too, by making it take them to a registration page configured to automatically subscribe them when they complete their registration. And an unsubscribe button seemed like a good idea. The end result of all this was the following template code which you can use in any WSN script as of 10.3.20 Beta 3:
<IF {THISMEMBERISREGISTERED} and {THISMEMBERNOTIFYOFLINKS} is yes>
<div class="addnewblog"><a href="index.php?action=unsubscribelistings" class="btn btn-info btn-lg"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> {LANG_GENERAL_UNSUBSCRIBEEMAIL}</a></div>
<ELSE>
<div class="addnewblog"><a href="index.php?action=subscribelistings" class="btn btn-info btn-lg"><span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span> {LANG_GENERAL_SUBSCRIBEEMAIL}</a></div>
</IF>

I noticed the blog theme, and so presumably other upgraded old themes as well, had a repeating pattern of magnifying glasses in the search input background due to the CSS rule #searchbox input { background-image: url('../images_blog/search.png'); } in the stylesheet. I think that was originally meant to be just shown on the left side of the input once and the base.css rule that made it only appear once must've been removed at some point after the idea was dropped f...

Read Full Blog Entry


By on Dec 07, 2018 at 4:51 PM (Edited Dec 07, 2018 at 4:51 PM)

Next to installing broken custom mod_security rules, the second most annoying thing web hosts do is set rediculously low maximum file upload sizes. Often they'll have upload limits of 2 MB, which isn't even enough to upload a photo taken from a phone. Confusingly, sometimes they have a large limit set for max_upload_filesize but then a small limit for max_post_size which also indirectly acts as a limit on the uploaded file size.

Because this results in a lot of support issues for me, in recent months I made WSN automatically configure the Admin -> Settings -> Files -> Max Attachment File Size to make it smaller than the php.ini limits set by the host. And yet, this ended up creating a different issue. After people go to their web hosts and ask for the limit to be increased, they're confused that they still get a message saying they can't upload larger files -- because they don't realize there's a setting they have to change.

The solution I implemented this week doesn't apply to old installations (for which this generally isn't an issue) but does apply to all new installs of 10.3. In all new installs, the Admin -> Settings -> Files -> Max Attachment File Size value is blank until manually filled in. A blank value is interpreted to mean "make the maximum be just below what the php.ini allows". WSN calculates the lower of the upload_max_filesize and post_max_size php.ini values in real time and makes that the dynamic upload size limit. The upshot of this is that when the host fixes the php.ini there's no need to change anything in WSN for larger files to start working. Most people get as large of files allowed as they can, and anyone who cares to set a low upload limit to protect their server disk space still has the option.


By on Nov 30, 2018 at 6:36 PM

Last night was openlayers (Open Street Map) headache night. Spent many hours pouring through contradictory documentation from the bazillion different versions of openlayers, and eventually discovered that there's a fundamental bug in it (or at least the version of it I'm using) where WebGL browser animations on the map cause the moveend and dragend events to fire about 50 times in a row. Eventually, the really ugly hack I came up with to be able to dynamically load more map pins on moveend/dragend was a timer which only adds more pins if it's been at least 5 seconds since last time. I can imagine this will lead to unpleasant little bugs where some pins don't show up after a quick series of zooms or pans. So it goes. At least Open Street Map now has some sort of support for dynamic pins. I was also able to make manual map location selection on the submit/edit map work for OSM. The biggest missing piece now is driving directions.

Today is video headache day. After spending the whole morning trying to get WSN to play videos and wondering why it wouldn't, I found a couple of problems. First, the easy one, I added $nobuffering = true; to download.php to prevent output buffering from messing up streaming video. The harder issue is that it turnes out HTML5 video only supports MP4, WebM and OGG. All other formats require the Flash browser plugin, which is no longer enabled by default in Chrome. This is a particularly big problem for all of you who've been using the convert to FLV switch and now have thousands of FLVs that a lot of people can't view.

So there's two things I needed to do for this. First, I needed to change the conver to FLV switch into a convert to MP4 switch -- so that videos people upload in unsupported formats get converted to a supported format. Then I needed a utility admins can run to convert existing videos. The latter will be far too resource-intensive to run automatically, so there's a prompt for it on the front page of the admin panel and then you...

Read Full Blog Entry


By on Nov 29, 2018 at 11:07 AM

When you upload a video to WSN and then play it on the listing details page, it plays through a javascript player interface called Flowplayer. Flowplayer is not actually included with the files of WSN, though. Instead, the javascript and CSS is referenced directly from flowplayer.org into your site. Partly this is because WSN is huge enough already, but mostly it's because Flowplayer is licensed under the GPLv3 and it's unclear what the legal implications would be if I distributed it (and I don't have money for a lawyer to find out). When picking WSN components, I normally choose MIT, BSD or LGPL licensed software because I know those licenses don't add any obligations for me to other code which I ship along side it, they only impact their own redistribution rights.

So anyway, normally it's no problem having flowplayer load from flowplayer.org instead of locally. But yesterday someone was having a problem with it because he was trying to play videos on a localhost installation on a computer that has no internet connection. In order to make it possible to use flowplayer without internet, I've added do-it-yourself support for a locally hosted version of flowplayer. All you need to do is save http://releases.flowplayer.org/6.0.3/skin/functional.css to jquery/flowplayerskin.css and save http://releases.flowplayer.org/6.0.3/flowplayer.min.js to jquery/flowplayer.min.js and then WSN will automatically use those local files instead of the flowplayer.org versions. This can also protect you in the event that flowplayer.org goes down, of course.



In other news, I've added openroute geocoding. Lots of redundant geocoding options now. We'll need openroute eventually for Open Street Map driving directions too. Since OpenCage provides a handy way to detect when the 2500 requests have been used, I'll make WSN automatically switch to openroute when OpenCage requires have been exhausted. Essentially you'll get 5000 geocodes per day now through the automatic combination of the tw...

Read Full Blog Entry


By on Nov 27, 2018 at 12:58 PM

Here's something everybody can use. Grab a free copy of the latest WSN Links 10.3.15, use the new bookmarks importer tool at Admin -> Links -> Add Links, and viola: you've got your personal favorite web directory with all the searching and sorting features you could want. You can let WSN automatically prune dead links or convert them to wayback machine versions during import. Link descriptions (meta description), tags (meta keywords) and associated RSS feeds can be imported automatically. The category structure, of course, will mirror the structure of your bookmarks folders.

I've tested this mostly on Chrome bookmarks, but verified Firefox works too at least for simple cases. Not sure about other browsers. There may be people with more complex bookmark structures than me who will need to report bugs, but I've got several levels of folders with 482 links importing nicely.

This could be a good way to share your bookmarks with your friends too, even enable the social tools to let them comment.
<< January 2019 >>
SunMonTueWedThuFriSat
12345
6789101112
13141516171819
20212223242526
2728293031