Forum Replies Created

Viewing 7 replies - 31 through 37 (of 37 total)
  • Thread Starter NettSite

    (@nettsite)

    Figured this out – it was caused by the theme I am using.

    Thread Starter NettSite

    (@nettsite)

    I have confused myself here:

    I have extended the post form using a plugin so that I can add items to the wp_postmeta table – I am using the post as a description for a product, and adding price, etc as additional data items.

    All of this works perfectly, except for a file upload item, which I need to add – e.g. if the “product” is a PDF file.

    By the time the post is saved, $_FILES is an empty array.

    Thread Starter NettSite

    (@nettsite)

    Christi N,

    Genius you are! I am now a very happy person, it works perfectly. Thank you very much.

    Regards,

    William.

    NettSite

    (@nettsite)

    How do I use php mail?

    NettSite

    (@nettsite)

    Hi, just had a look at your site – did you give up? I so like this template, but have the same question that you do.

    Thread Starter NettSite

    (@nettsite)

    Hi Mark,

    Upon scratching around in the code I have found that the casting to an integer is all over the place – doing a text search on a new install of WP 3.3 finds over 600 instances of “(int)”. In addition, there is a absint() function in functions.php which returns the absolute integer value of anything passed to it, which is also liberally called.

    It would be nice to understand why this is done, it seems to be a deviation from “best practices”.

    “PHP does not require (or support) explicit type definition in variable declaration; a variable’s type is determined by the context in which the variable is used.” (PHP Manual)

    I have followed your suggestion and posted on wordpress.stackexchange.com as well, with no responses so far.

    Thread Starter NettSite

    (@nettsite)

    Hi Mark,

    Thanks for the reply.

    I need the key to be universally unique, at least within the domain of several WordPress websites. The idea is to synchronise posts and other data between the sites in such a way that a post created on any site is available to every other site as well. The different websites will be on different servers in different locations.

    The autoincrement functionality which WP relies on will clearly cause the same key to be used in the corresponding table of each WP site for different posts, i.e. the first post in each website will be 1, where I need it to be something different in each website so that I can merge the data from each website into every other website.

    Hope that is a bit clearer!

    I am trying using PHP’s uniquid() function to generate the key, and that produces a 13 character string, which converts into a decimal which is smaller than a BIGINT in MySQL, so that is cool, and my override for wpdb successfully writes it into the database, but PHP’s integer is much smaller – a little over 2,000,000,000, I can’t remember offhand the exact size. When PHP receives the BIGINT from MySQL, it would normally manage it as a float because it is bigger than PHP’s int, but casting it as int in PHP has the effect of truncating it.

    So, I am going to try and remove the “(int)” casting and see if that solves my problem, although as I said earlier I would prefer not to make changes to the WP core at all.

    I am concerned, though, that doing so may solve my immediate need and leave me with a worse problem somewhere else, and wondered if anyone had followed this path before, and also why the original authors had done the specific casting – I love PHP’s loose data typing, so it’s not something that I would do unless there was a specific reason. I have sufficiently burnt fingers to respect other programmer’s reasons enough to try and find out what they are, thus the question.

    Regards,

    William.

Viewing 7 replies - 31 through 37 (of 37 total)