Forum Replies Created

Viewing 15 replies - 1 through 15 (of 44 total)
  • Thread Starter Michael4fm

    (@michael4fm)

    Hi again Rangi

    I’ve actually found a file copy of my template for single posts with this in. Sometimes it’s easier to start from something and adapt it to do what you want, rather than start from scratch. At least, I find it so. If a copy of it would be helpful, just ask! ??

    Thread Starter Michael4fm

    (@michael4fm)

    Hi Rangi

    Kind of … you can use the string length formula dotnordic gave above within a template.

    I ended up using several, so ….

    if( string length > 1 ) print a
    if( string length > 2 ) print a
    if( string length > 3 ) print a
    if( string length > 4 ) print a … etc. (could be print a; print b; print c; etc.)

    I used this on single post templates. A bit long winded to set the template up but once done you can forget about it. (In my case, I also made an extra custom field to generate 1 | 2 | 3 extra ‘a’s, if they were needed for a particular post – for example because there were lots of sub-headings and short sentences which meant the actual string length of the content was quite low. I don’t use this any more, so can’t point you to an example, sorry.

    If you want to match sidebar length on pages with multiple posts – e.g. category lists, post lists, etc., I’ve cheated. Instead of having a sidebar, I include what would have been in the sidebar within the post format. This only works where you want the same thing, or sort of thing, for each listing. I use the RANDOM TEXT plugin so that the wording in the template is constant, but the actual output is random.

    Example here: A category page on my site

    (Some of) the items on the right are randomly generated by that plugin. If I changed the settings to list eight posts instead of four, it would generate eight (or however many are needed) ‘extra’ items, so there’s no ‘white space’. This example actually generates the content randomly twice – which category it prints from is chosen randomly from a list of possible categories I’ve defined. Clever, in a way, I thought … but actually really easy to do, once you understand the basic idea.

    If you want to show ‘widget 1’ for short lists, if it’s long enough show ‘widget 2’, if it’s still longer show ‘widget 3’ etc. … you could do that via the top method. No reason it wouldn’t work on a multiple posts template as well as a single one. Just a bit harder – I guess – to automatically work out how long the string is, and you’d have to decide in advance a maximum length, so you’d know how many “if” statements you need.

    Hmmm. I may have made it sound more confusing than it actually is! It’s fairly easy. Just takes a little time and experimenting to get it to work / look how you want.

    Hope this helps. Feel free to ask a more detailed question if you decide to try one of the methods and get stuck. I’m not ‘all knowing’ but at least I have the benefit of some small amount of experience.

    Best regards

    @jerome45r: Just delete the plugin via FTP by deleting its directory entry. When you then refresh the plugin page on your dashboard it will have disappeared – you’ll get the message ‘Plugin WP Ultimate CSV Importer Plugin deactivated as the plugin directory doesn’t exist’ (or something like that).

    You can then re-add the plugin in the same way you would if it was a completely new one. This will install the new version of v.3.2.0 which has got this bug fixed.

    Key is to be able to access your files via FTP. As long as you can do that, it’s easy. If you can’t …. errr …. then I’m stuck, to be honest! ??

    Hmmm. Not exactly sure how my post was a waste of time.

    I thought I was (1) thanking the developer and confirming the ‘fix’ worked; (2) Advising them of something they may or may not have been aware of for future upgrades / bug fixes to make users’ lives easier; (3) Sharing a simple ‘fix’ for anyone else that finds this thread who is encountering the issue and doesn’t know what to do about it.

    As I have no idea what a sock puppet is (apart from the obvious, obviously) I have no idea whether that’s meant to be an insult or a compliment! ??

    Thanks, Smackcoders. Certainly seems to have worked for me.

    Minor point but v.3.2.0 was the release that had the problem. Don’t know if doing another release – say v.3.2.0.1 – is a huge palava so you’ve just edited / added / replaced the offending file, but the result is that ‘re-upgrading’ isn’t straight forward, nor will notifications be sent out (I think) to anyone who has already upgraded to the version with the bug.

    [If anyone’s encountering this problem, the solution is actually quite simple … delete the “WP Ultimate CSV Importer” plugin via FTP then re-add it as if it were a new one. Don’t think there are any settings to worry about losing, but even if there are things should just work as if you’ve deactivated then reactivated it.]

    @zacsmith: Well, in fairness to the developer the plugin works – and works well. I’ve used it SINCE this problem to import a fairly large database in CSV format (several times, actually, as I keep adjusting the database in a different form!)

    It only causes a problem if you want / need to deactivate it. It’s a bit unfortunate that this is exactly what you need to do when you’re trying to work out which plugin – if any – is causing a particular problem.

    It must be difficult to code for all eventualities, many different server types, versions of PHP, etc. And just the addition or omission of a comma or semi-colon in the wrong place can have some horrible consequences (though usually only temporary .. till you work out where the error is!)

    + another 1 …. me too.

    (If anyone else is having this problem and is stuck, an alternative ‘work around’ is to rename the plugin’s directory under “…/wp-content/plugins/…” – e.g. just put an ‘x’ at the start of the directory name. This will automatically deactivate it when you refresh the plugin page. To reactivate, simply rename the directory back to the original name and activate as usual.)

    Thread Starter Michael4fm

    (@michael4fm)

    Blimey! Easier than I thought! If anyone else comes looking, here’s the php code:

    <?php $mycat = do_shortcode('[randomtext category="funnycat"]'); echo do_shortcode('[randomtext category="'. $mycat . '"]'); ?>

    I’m using do_shortcode because the RANDOM TEXT shortcode is designed to print its output. do_shortcode only prints if you prefix it with echo. The categories that you want to randomly select from can then be added into a new RANDOMTEXT category – in this case ‘funnycat’. RANDOM TEXT will then randomly select from this category, then use that category for the actual RANDOMTEXT output.

    Advantage is that you can add as many categories to select from randomly, and use this with as many ‘groups’ of category as you want … just use different RANDOM TEXT category names.

    This code works directly in posts BUT you need to have a plugin running to allow php in posts. It SHOULD work directly in templates too. Haven’t tried yet, off to do so now. ??

    If there’s a still easier way, I’d love to know it. If not, I’ll mark this thread as ‘resolved’, and hope that one day it helps someone else.

    Thread Starter Michael4fm

    (@michael4fm)

    Can I add another question … for which hopefully there’s an easy answer – besides ‘no’, obviously …

    Is there a (relatively easy) way to have the question show between the entered comment text and the ‘Post comment’ button, instead of between the ‘Who are you’ fields and the comment text?

    Just seems logical to me that that’s where it should go … this is who I am, then this is what I want to say, then “Say it”. The ‘captcha’ is part of the ‘say it’ process, but every captcha I’ve seen puts it in the same place yours does with no option to put it somewhere else. Perhaps it’s just ‘easier’ to put it where it is?

    Thread Starter Michael4fm

    (@michael4fm)

    Hi Mike

    I’ve activated the plugin … you can test it at:

    Plugin test at s-t-u-f-f

    It’s a ‘clean’ install of the plugin, so it’s using the ‘default’ questions and answers. Also, I’ve just realised – having then half hoped it would still not work and half hoped that it would! – that this behaviour is occurring on two different ‘servers’ … the shared one my ‘live’ website is hosted on, and my own PC acting a a ‘dummy’ server using WAMP for testing and developing.

    Please excuse the ‘look’ of the site right now. I’m in the process of upgrading to WP3.6 along with some other plugins such as BuddyPress and it had some effects which I’m ironing out off-line then uploading the correct stuff. Depending on how quickly you have time to take a look, the page MAY look a little odd (hmm … actually, quite a bit, from what I’ve just seen!).

    Hope you can figure out why it’s not working as it should. If you need me to add / change stuff, or need more information, just ask. I’ll be playing just about all day, so tweaking things to ‘test’ won’t be a problem.

    Best regards

    Michael

    This sounds just like the issue I came here looking for an answer to … using XAMPP, using Firefox as standard (though same issue with IE, Chrome and Opera) … off-line site is fine, online site – which I believe to be identical – no image.

    Example of problem at: https://s-t-u-f-f.net/plugin/add-functions/

    Any progress / suggestions ?

    For info:

    I’ve just spent the best part of the day removing a bug whereby my database needed continually to be optimized. As soon as it was, it needed doing again.

    By a process of elimination, seems to be caused by this plugin. So I’m going to (reluctantly) stop using it.

    Have found a plugin called BAW Like Unlike offers similar basic functionality, though I’ve yet to see if I can get it to act as a complete replacement.

    Best regards

    Michael

    @klineal

    Thanks everso for this temporary fix. Love the plugin, if for no other reason than I’m pretty sure the functionality is unique, but I had to deactivate it so very often to make minor changes elsewhere. Your suggestion seems to have cured the problem completely. (LOL .. though I’ll probably forget what I did next time I need to make admin changes to kkIlikeit!)

    I’ve double checked, and am pretty sure there’s no sarcasm above ??

    Thread Starter Michael4fm

    (@michael4fm)

    OK … I possibly take back the “if function exists” comment! ??

    When I wrapped it in ticks, the fatal error went away. But when I reactivated the plugin, the button didn’t show till I deleted the ticks.

    Officially confused.

    :-))

    Ditto. Haven’t tried on my remote server … figured if I can’t get it to work locally I need to find another way. Shame, as it looks exactly what I needed.

Viewing 15 replies - 1 through 15 (of 44 total)