WordPress.org

Forums

where (16 posts)

  1. Anonymous
    Unregistered
    Posted 11 years ago #

    where can I find my-hacks.php
    I have searched all over for it, I can't find it.
    I must be blind. please help

  2. Mark (podz)
    Support Maven
    Posted 11 years ago #

    It's not there :)
    You need to make it.
    Open Notepad (or similar)
    Type this, and ONLY this:
    <?php
    ?>
    Now save that as 'my-hacks.php'
    See here as well - http://wiki.wordpress.org/index.php/my-hacks.php

  3. Anonymous
    Unregistered
    Posted 11 years ago #

    ok, I found how to do it at the wiki, and I did it just as written there, but still I am getting an error:
    Parse error: parse error, unexpected T_REQUIRE_ONCE in /www/htdocs/v109938/blog/my-hacks.php on line 3
    Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/v109938/blog/my-hacks.php:3) in /www/htdocs/v109938/blog/wp-admin/post.php on line 409
    Help!

  4. Mark (podz)
    Support Maven
    Posted 11 years ago #

    There are a couple of ways to use a my-hacks file.
    Can you post the contents of your file here ?
    - and use the backticks :)

  5. Anonymous
    Unregistered
    Posted 11 years ago #

    <? php
    require_once(ABSPATH.'hacks/psnGallery.php');
    ?>

    argh!

  6. Mark (podz)
    Support Maven
    Posted 11 years ago #

    If your my-hacks.php is in the same directory that your index.php is, and your hacks *folder* is also in that directory, just use this:
    <?php require_once('hacks/psngallery.php'); ?>

  7. Anonymous
    Unregistered
    Posted 11 years ago #

    nope, didnt work, now I am getting this:
    Warning: main(hacks/psngallery.php) [function.main]: failed to create stream: No such file or directory in /www/htdocs/v109938/blog/my-hacks.php on line 1
    Fatal error: main() [function.main]: Failed opening required 'hacks/psngallery.php' (include_path='.:..') in /www/htdocs/v109938/blog/my-hacks.php on line 1

  8. Mark (podz)
    Support Maven
    Posted 11 years ago #

    Okay ... I would suggest that your folder called 'hacks' be moved to your WP directory.
    It's safe there, and will not be overwritten.
    Here's my structure
    /T2
    index.php
    my-hacks.php
    /T2/hacks
    all my hacks
    and here is my 'my-hacks.php'
    <?php require_once('hacks/archive.php'); ?>
    <?php require_once('hacks/days_since.php'); ?>
    <?php require_once('hacks/days_to.php'); ?>
    <?php require_once('hacks/get_comment_count.php'); ?>
    <?php require_once('hacks/get_comment_word_count.php'); ?>
    <?php require_once('hacks/get_most_commented.php'); ?>
    <?php require_once('hacks/get_post_count.php'); ?>
    <?php require_once('hacks/get_post_word_count.php'); ?>
    <?php require_once('hacks/get_recent_posts.php'); ?>
    <?php require_once('hacks/comment_plugger.php'); ?>
    <?php require_once('hacks/waypath2.php'); ?>

  9. Anonymous
    Unregistered
    Posted 11 years ago #

    ..hmmm, it IS already inside the wp directory
    ...I really dont't get it.

  10. Mark (podz)
    Support Maven
    Posted 11 years ago #

    <?php
    require_once('hacks/psnGallery.php');
    ?>

    *should* work .....
    There aren't any extra spaces creeping in are there ?
    Esp between the ? and php

  11. Anonymous
    Unregistered
    Posted 11 years ago #

    Ok. I gave up on that, now I got a different hack for coppermine, that does the same thing, with less code, but even now I am getting errors!
    I am about to freak!
    ok, this is the code here: http://www.lennartgroetzbach.de/phps/cpg.plugin.phps
    this is the site I want it on: http://www.riding-shotgun.de/blog (the last post is the one with the image tag)
    and this are the errors I am getting:
    after I post: Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/v109938/blog/cpg.plugin.php:118) in /www/htdocs/v109938/blog/wp-admin/post.php on line 158
    and intead of where there should be an image, I get this:
    SQL/DB Error:
    [You have an error in your SQL syntax near 'OFFSET 4' at line 1]
    SELECT filepath, filename, title FROM pix_pictures WHERE aid=5 ORDER BY 5 LIMIT 1 OFFSET 4
    WTF????????
    pleaseeeeeee! help!

  12. Nick Momrik
    Member
    Posted 11 years ago #

    "Cannot modify header information - headers already sent" is usually an indication that you have extra blank lines in your my-hacks file either before the opening <?php or after the closing ?>

  13. Anonymous
    Unregistered
    Posted 11 years ago #

    I know, but I've checked----
    see here: http://www.riding-shotgun.de/blog/my-hacks.php
    and what is the other error message? anybody know?

  14. Mark (podz)
    Support Maven
    Posted 11 years ago #

    It seems as though there are 2 errors to be tracked and sorted, so the best way is to eliminate them one by one.
    Can you install another hack - any hack - and get your 'my-hacks' working without the hack that you really want (the gallery one).
    Once that works, it will be easier to nail the second problem.

  15. Nick Momrik
    Member
    Posted 11 years ago #

    Or...can you get my-hacks.php working with simply
    <?php ?>
    in it and nothing else?

  16. Anonymous
    Unregistered
    Posted 11 years ago #

    Ok, we are getting there! I got rid of the first error: Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/v109938/blog/cpg.plugin.php:118) in /www/htdocs/v109938/blog/wp-admin/post.php on line 158
    it wasn't because of a space in my hacks.php but in the actual cpg.plugin.php that I had created.
    but I am still getting this: SQL/DB Error:
    "[You have an error in your SQL syntax near 'OFFSET 4' at line 1]
    SELECT filepath, filename, title FROM pix_pictures WHERE aid=5 ORDER BY 5 LIMIT 1 OFFSET 4" instead of an image after I post.
    thank you so much for your help!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.