Log in | Register | Lost password

  • Start :: 
  • Photoshare :: 
  • Other :: 
  • Question for Hack in NS-AddStory -like "Hack Submit News"
Bottom
Question for Hack in NS-AddStory -like "Hack Submit News"
  • Posted: 13.03.2004, 16:22
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Hello. I saw the Hack in index.php (Submit News) to choose Images from Photoshare.
    I`d like to offer this in Add Story.
    I tryed it like this in addstory_functions.php:
    [php]echo "\n";
    $photoshareFindImageURL = pnModUrl('photoshare','user','findimage',
    array('url' => 'relative', 'html' => 'img'));
    echo "

    "._STORYTEXT."
    "
    ."<textarea cols="\"80\"" rows="\"10\"" name="\"hometext\"">";
    // Remove br tags only if format of hometext is 'text'.
    if ($format_type_home == 0)
    {
    echo pnVarPrepForDisplay(unnltobr($hometext));
    } else {
    echo pnVarPrepForDisplay($hometext);
    }
    echo "</textarea>
    "
    ."<input type="\"button\"" value="\"Insert" />";[/php]
    The window to select the Image opens and I can choose.
    After pushing the Button "choose Image" nothing happens.
    - Perhaps someone can help me :)
  • Posted: 13.03.2004, 23:54
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Your problem is simply that you need to add an id to your TextArea, for instance

    Code

    echo "<textarea cols=\"80\" rows=\"10\" name=\"hometext\" id=\"homeTextarea\">";

    and later reuse the same id in PhotoshareFindImage :

    Code

    echo "<input type=\"button\" value=\"Insert Image\" "

    . "onClick=\"photoshareFindImage('homeTextarea'

    ,'$photoshareFindImageURL')\">";
  • Posted: 14.03.2004, 11:08
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Ahhh! Thank you. -I already asked myself what`s going on with "hometext"...
    That`s it.
    Greets, mike
  • Posted: 18.03.2004, 18:35
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Hi! I'd like to offer this option in Add_Story to, could you post the complete code and which files I need to update please? Thanks VERY MUCH in advance!!!
  • Posted: 19.03.2004, 11:42
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Of corse :)
    Download here:
    http://www.drafts.de/modules.php?op=modload&name=Downloads&file=index&req=viewdownload&cid=1&min=10&orderby=titleA&show=10
    (Photoshare Hack f?r News) -If you want to take a look in the code ;)

    Greets, mike
  • Posted: 28.05.2004, 08:47
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Great Hack! I only have one problem tho....
    The hack posts the image and everything into the article, yet instead of posting the picture, it posts the url to the image, like this::



    Any Ideas? Thanks for your time!
  • Posted: 28.05.2004, 09:33
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    It seems to me that you forgot to allow the img tag. So go to Administration -> Settings and scroll down until you see the list of HTML tags. Find the line for the img tag and check the LAST column (IMPORTANT : you NEED to allow it WITH parameters !!). Return to your story page and you should see your picture :D

Template courtesy of Designs By Darren.