WordPress.org

Ready to get started?Download WordPress

Forums

Duotone PHP Error on WordPress 2.9 (39 posts)

  1. blig
    Member
    Posted 4 years ago #

    Hello, i've just installed the Duotone theme on a self-hosted wordpress 2.9 instance. I tried the preview and it's giving me this error:

    Warning: Missing argument 1 for is_vertical(), called in [...]/wp-content/themes/duotone/functions.php on line 18 and defined in [...]/wp-content/themes/duotone/inc/duotonelibrary.php on line 295

    I'm currently using Monotone, which is still working fine.
    Anyone had a similar problem? Hints?

    Thanks
    E.

  2. berrics
    Member
    Posted 4 years ago #

    Hey there,

    getting the same error msg on mine aswell. Also using wp 2.9.

    "

    Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /home/wruuu/public_html/wp-content/themes/duotone/inc/duotonelibrary.php on line 301

    Warning: Missing argument 1 for is_vertical(), called in /home/wruuu/public_html/wp-content/themes/duotone/functions.php on line 18 and defined in /home/wruuu/public_html/wp-content/themes/duotone/inc/duotonelibrary.php on line 295

    Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /home/wruuu/public_html/wp-content/themes/duotone/inc/duotonelibrary.php on line 301
    "

    Also the archive does not open at all.

    Tried to upload it to another hoster and for some reason it worked fine. I also downgraded to version 1.0 of this thema but getting the same error /msg.

    Anyone know to solve this problem?

    Cheers

  3. blig
    Member
    Posted 4 years ago #

    Ok just playing here and there:

    Line 18 in functions.php for monotone is
    $width = (is_vertical() ? MIN_WIDTH : MAX_WIDTH;
    The "Missing Argument" error is apparently solved changing the line like this: $width = (is_vertical($post->image_url)) ? MIN_WIDTH : MAX_WIDTH;

    @berrics The "Filename cannot be empty" error still there; same problems with the archives not working.

  4. berrics
    Member
    Posted 4 years ago #

    jup, thanks, the "Missing Argument" error is solved but the other error remain. Anyone knows how to fix it?

    Thanks in advance.

  5. noel
    Member
    Posted 4 years ago #

    The is_vertical issue is solved in the latest release 1.0.1

    The other error means that somehow the path to your images isn't being sent properly to the function.

    Do you have a URL where this is happening?

  6. blig
    Member
    Posted 4 years ago #

    I'm temporarily shifting to duotone here http://www.stilemosso.it so you can take alook. Version is the 1.0.1

  7. blig
    Member
    Posted 4 years ago #

    PS
    The getimagesize error can be seen in the "gears" page.
    The archive page (which i guess is dynamic) is giving a "4o4 not found" in the body and an error in the URL! "Missing argument 1 for get_year_link() called in [...]/wp-content/themes/duotone/header.php on line 41 and defined in [...]/wp-includes/link-template.php on line 286'

  8. blig
    Member
    Posted 4 years ago #

    Ok i don't want to populate the topic alone but here's the latest:
    - The getimagesize warning seems to appear when there is no image to use as a thumbnail; this happens on posts and pages
    (on my side i put images also when i didn't need them to avoid the error messages, but i think there should be the possibility to have no images)
    - The archive page link is not working but the archives do
    (eg: ok when using them from the archive widget)

    One good thing: with some "content tuning" it's much better yet
    One notsogood thing: warnings expose all the paths and break the layout

  9. christopherokc
    Member
    Posted 4 years ago #

    I have upgraded to 1.0.1 and still getting the same issue as the original post.

    PHP 5.2.10
    GD 2
    WP 2.9

    I completely deleted and reinstalled the duotone theme with 1.0.1. The two tone colors are changing to match the photos, exif data is being displayed, but no photo is displayed.

    Message in browser:
    Warning: Missing argument 1 for is_vertical(), called in /var/www/wp/wp-content/themes/duotone/functions.php on line 18 and defined in /var/www/wp/wp-content/themes/duotone/inc/duotonelibrary.php on line 295

    Message from php.log:
    [30-Dec-2009 16:28:03] PHP Warning: Missing argument 1 for get_year_link(), called in /var/www/wp/wp-content/themes/duotone/header.php on line 41 and defined in /var/www/wp/wp-includes/link-template.php on line 286
    [30-Dec-2009 16:28:03] PHP Warning: Missing argument 1 for is_vertical(), called in /var/www/wp/wp-content/themes/duotone/functions.php on line 18 and defined in /var/www/wp/wp-content/themes/duotone/inc/duotonelibrary.php on line 295

    monotone works just fine. every other theme i've installed works just fine.

  10. blig
    Member
    Posted 4 years ago #

    Hello!
    Here's my hacks for the warnings found til now:

    1) Missing argument 1 for is_vertical(),
    Change $width = (is_vertical() ? MIN_WIDTH : MAX_WIDTH;
    into $width = (is_vertical($post->image_url)) ? MIN_WIDTH : MAX_WIDTH;
    in functions.php or upgrade to verson 1.0.1 as sayd by Noel

    2) getimagesize() [function.getimagesize]: Filename cannot be empty
    Work on content: make sure that every post has an image associated

    3) Missing argument 1 for get_year_link()
    change <?php echo get_year_link(); ?>
    into<?php echo get_year_link(''); ?> in header.php

    4) 404 not found error on archives page
    Work on content: make sure that there is almost one item posted in the last year

    PS:
    to developers:
    about 2) and 4) it would be good to allow to have also posts/pages without images and to avoid error messages if there are no recent-recent posts (as it may happen on jan the 1st :)

  11. langwitches
    Member
    Posted 4 years ago #

    I have changed the header.php and function.php as described above and am not getting the "missing argument" error anymore.
    But...
    I still cannot get my images to show up not on the individual posts nor in the archive pages.

    http://www.langwitches.org/blog/photos/

    Any help would be appreciated.
    Thank you

  12. berrics
    Member
    Posted 4 years ago #

    Here is what I did and it worked pretty good:

    Put at least one image in each post to avoid the error msg.

    Change the functions.php like Noel said.

    To avoid the nasty archive error, just put the archive-url http://www.yourdomain.com/2010/ buy yourself into the header.

    ...and by the way thanks for the nice theme! :)

  13. berrics
    Member
    Posted 4 years ago #

    Oh and on another note it seems like can NOT post images which are NOT on your server. In order to safe a little bit of traffic you might want to host some pictures on, lets say, imageshack but then the theme turns the Url into:

    <img src="/wp-content/themes/duotone/inc/thumb.php?image=http://img15.imageshack.us/img15/2448/1235.jpgw=840" border="0"/>

    Or am I missing something here? The WordPress HTML Editor says

    <img style="border: 0pt none;" src="http://img15.imageshack.us/img15/2448/12345.jpg" border="0" alt="" width="1218" height="734" />

  14. mlanger
    Member
    Posted 4 years ago #

    I'm also having problems with this theme and would really like to see them fixed. I tried hacking the files as instructed here but must have screwed something up. I'm hoping a new, fixed version is available soon. I like this theme much more than its predecessor, Monotone.

    Thanks.

  15. christopherokc
    Member
    Posted 4 years ago #

    I have changed the php in functions.php to:
    $width = (is_vertical($post->image_url)) ? MIN_WIDTH : MAX_WIDTH;

    This was still missing in 1.0.1, so the upgrade didn't work.

    Still not working. The errors/warnings are gone. The images do not show up. No images are being displayed for every post. All the images are local. All posts have an image. The posts are showing the two tone colors for each image. The posts are showing the EXIF data for the images. Everything else is working properly. Every other theme I've installed, including monotone, works properly.

    I even completely wiped WP, reinstalled it from scratch with 2.9, reinstalled duotone from scratch with 1.0.1. Changed the functions.php with the missing $post->image_url. Still not showing images. No other plugins, themes, etc are installed.

  16. daftduc
    Member
    Posted 4 years ago #

    Hi.

    I'm having trouble with the theme. I have done everything mentioned above to fix those problems. However, my problem is that images I posted do not show up.

    Here is my photoblog: http://ttcceo.site50.net/photo/

    Please take a look at it and tell me what to do to fix this problem.

    Thanks.

  17. blig
    Member
    Posted 4 years ago #

    RSS bug found in template?
    EG: http://www.siteurl.it/feed/

    gives this kind of error

    This page contains the following errors:
    
    error on line 12 at column 34: Entity 'laquo' not defined
    Below is a rendering of the page up to the first error.
  18. EKD
    Member
    Posted 4 years ago #

    Have now downloaded Duotone 1.0.1 twice (deleted first download, downloaded and installed again), and still have error message:

    Warning: Missing argument 1 for is_vertical() in /homepages/13/d300699809/htdocs/journal/wp-content/themes/duotone/inc/duotonelibrary.php on line 295

    Have gone into the duotonelibrary.php file and all is correct as suggested in fixes above:
    $width = (is_vertical($post->image_url)) ? MIN_WIDTH : MAX_WIDTH;

    Have actually searched for the string
    Missing argument 1 for is_vertical()
    and that text cannot be found.

    Thoughts, help?
    See page at
    http://ekingdesign.com/journal

  19. EKD
    Member
    Posted 4 years ago #

    Found that the line 295 causing the error message is:

    function is_vertical($url) {

  20. odyssey
    Member
    Posted 4 years ago #

    2) getimagesize() [function.getimagesize]: Filename cannot be empty
    Work on content: make sure that every post has an image associated

    My friend told me how to fix this problem.
    By using php.ini, write as follows plz.

    allow_url_fopen = on

    I could solve.
    FYI//

  21. johnhennmacc
    Member
    Posted 4 years ago #

    It looks as if this theme only works if you installed WordPress into the root of the web server folder and not a subfolder. The problem that I have seen is in the fake_rewrites function where text substitution is making a URL unusable.

  22. richimages
    Member
    Posted 4 years ago #

    My experience confirms the above comment ... THAT IMAGES ONLY APPEAR WHEN WORDPRESS IS INSTALLED AT THE BASE URL FOR THIS THEME.

    ==========================

    My primary WordPress blog sits at the root level of my URL:
    http://www.RichImages.net/

    ( This theme will show images for Duotone after making the $post->image_url fix as above, )

    =============

    BUT !!!!

    The second photoBlog Only WordPress installation at:
    http://www.RichImages.net/showcase

    Will not show the images in the post after making the $post->image_url fix!

    Something is not recognizing where WordPress is exactly installed, and is guessing it to be installed at the Root Level!

  23. richimages
    Member
    Posted 4 years ago #

    Okay ... hacking a bit here:

    For those of you who are having problems seeing images show up, due to having WordPress operating at some place other than the ROOT directory of the URL, here's where the problems seems to be:

    Look in the file <functions.php> ... Look at the line that reads:

    return str_replace(get_bloginfo('wpurl'), '', preg_replace('/src=("|\')([^\1]+)\?w=[0-9]+(\1)/','src="'.$thumby.'?image='.addslashes( "$2").'&w='.$width.'"',$tag) );

    From my hacking, it appears that the problems is there somewhere.

    If you change the line to simply:
    return $tag;

    Then your images will show.

    I'm having problems with centering and perhaps sizing ... but this is a starting place for an ultimate fix.

    good luck all.

  24. richimages
    Member
    Posted 4 years ago #

    Here's some debug print statements that were inserted info <functions.php> :

    print "DEBUG: get_bloginfo is: " . get_bloginfo('wpurl') . "\n";
    print "DEBUG: thumby is: " . $thumby . "\n";
    print "DEBUG: width is: " . $width . "\n";
    print "DEBUG: tag is: " . $tag . "\n";

    Here's the Output Results :

    DEBUG: get_bloginfo is: http://richimages.net/showcase
    DEBUG: thumby is: http://richimages.net/showcase/wp-content/themes/duotone/inc/thumb.php
    DEBUG: width is: 560
    DEBUG: tag is: <img src='http://richimages.net/showcase/wp-content/uploads/2010/02/barceloHotel_027-e1265467175233.jpg?w=560' title="Barcelo Hotel Grounds" alt="" />

    Does anyone know what the original line:

    return str_replace(get_bloginfo('wpurl'), '', preg_replace('/src=("|\')([^\1]+)\?w=[0-9]+(\1)/','src="'.$thumby.'?image='.addslashes( "$2").'&w='.$width.'"',$tag) );

    is doing here? I code a bit, but am unsure what this replacement is doing. The output from the above original was :

    <img src="/wp-content/themes/duotone/inc/thumb.php?image=/wp-content/uploads/2010/02/barceloHotel_027-e1265467175233.jpg&w=560" title="Barcelo Hotel Grounds" alt="" />

    which has incomplete paths that cause the images to not appear.

    Thanks for any help.

  25. notodoyago
    Member
    Posted 4 years ago #

    Blig--
    your sight looks fabulous. How did you get it to work? A novice at this. My pictures aren't resizing to fit.

    Any help would be appreciated!

    Thanks!!
    Shab

  26. ravikaushik
    Member
    Posted 4 years ago #

    I'm trying to migrate noisypilgrims.wordpress.com which runs duotone already to a self hosted site. I'm facing the above problems too and the fixes don't seem to work :(
    Any help?

  27. notodoyago
    Member
    Posted 4 years ago #

    The only way I can get it to work is to post in the wordpress.com, export it. I change my theme to the default with the green title (can't remember the name at the moment), and then import--It only works without the attachments for me.

    Once everything is imported then I changed the theme back to duotone and it works fine.

    Of course, this is far too much work to make a website act correctly. Also, all of the photos are still on the wordpress.com site so it defeats the purpose of moving.

    I never heard back from anyone on this, but I'll update if I ever figure it out.

  28. kinobox
    Member
    Posted 4 years ago #

    Please could someone help me solve this problem.
    I made the change from 18, so it is giving this error:

    Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in / home/kinobox1/public_html/wp-content/themes/duotone/functions.php on line 18

    I left the monotone to duotone. I can not view the blog.
    I do not know what to do. thanks.

    http://kinobox.ws

  29. kinobox
    Member
    Posted 4 years ago #

    problem solved!

  30. aniraangel
    Member
    Posted 4 years ago #

    On this site I'm working on: http://resources.unearthlytales.net/

    I get these errors, with the latest wordpress and duotone:

    Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in /home/unearthl/public_html/resources/wp-content/themes/duotone/inc/duotonelibrary.php on line 301

    Warning: getimagesize(http://resources.unearthlytales.net/wp-content/uploads/2010/03/ebon.pyorre.net_1269611877450.png) [function.getimagesize]: failed to open stream: no suitable wrapper could be found in /home/unearthl/public_html/resources/wp-content/themes/duotone/inc/duotonelibrary.php on line 301

    Warning: Missing argument 1 for is_vertical(), called in /home/unearthl/public_html/resources/wp-content/themes/duotone/functions.php on line 18 and defined in /home/unearthl/public_html/resources/wp-content/themes/duotone/inc/duotonelibrary.php on line 295

    Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /home/unearthl/public_html/resources/wp-content/themes/duotone/inc/duotonelibrary.php on line 301
    <img src="/wp-content/themes/duotone/inc/thumb.php?image=/wp-content/uploads/2010/03/ebon.pyorre.net_1269611877450.png&w=840" class="alignnone size-full wp-image-4" title="The Everchanging Book of Names" alt="" />

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags