Results 1 to 6 of 6
  1. #1
    Banned impulsive's Avatar
    Joined
    Apr 2007
    Posts
    83
    Thanks
    Received:0
    Given: 0

    Image lost after editing the story

    If you edit any story in admin mode, the edited version will stop displaying any images earlier shown with the story even if you attach them to story again.

    Thanks

  2. #2
    Senior Member not2serious's Avatar
    Joined
    Apr 2007
    Posts
    231
    Thanks
    Received:0
    Given: 0
    Please refer to prior forum post: Error in submitting stories!

  3. #3
    New Pligger chungbs's Avatar
    Joined
    Jun 2007
    Posts
    4
    Thanks
    Received:0
    Given: 0
    Quote Originally Posted by impulsive View Post
    If you edit any story in admin mode, the edited version will stop displaying any images earlier shown with the story even if you attach them to story again.

    Thanks

    i also have the problem when i using it...
    so i try some ways to fix it

    1) the easy way is change two file at below, but everytime when you edit the story, you must upload the image.

    file : /templates/yget/editlink_edit_center.tpl
    <form action="" method="post" id="thisform">
    change to
    <form action="" method="post" id="thisform" enctype="multipart/form-data">


    file : /editlink.php
    $linkres->store();
    add this line ---> check_actions('image_upload_process');
    header('Location: ' . getmyurl('story', $_POST['id']));



    2) this way is better, don't need to upload image when edit, but more file to change.

    file : /templates/yget/submit_extra_fields.tpl
    <input type="file" name="link_field1" id="link_field1" size="20" class="form-full" />
    add this line ---> <input type="text" name="image_field" id="image_field" value="{$submit_link_field1}" size="60"/>
    </p>


    file : /templates/yget/editlink_edit_center.tpl
    <form action="" method="post" id="thisform">
    change to
    <form action="" method="post" id="thisform" enctype="multipart/form-data">


    file : /editlink.php
    $linkres->link_field1 = trim($_POST['link_field1']);
    change to
    $linkres->link_field1 = trim($_POST['image_field']);
    ...........................
    $linkres->store();
    add this line ---> check_actions('image_upload_process');
    header('Location: ' . getmyurl('story', $_POST['id']));


    file : /modules/image_upload/image_upload_main.php
    $smarty->plugins_dir[] = image_upload_plugins_path;
    add this line ---> if ($_FILES[module_imageupload_filename_field]['name'] != ""){
    // Get the image real name, temp name, submission ID
    ..........................
    $db->query("UPDATE ".table_links." set ".module_imageupload_filename_field."='$destFi le' WHERE link_id='$linkID'");
    }
    add this line ---> }


    when edit finished after submit, you will see the story page, but some time i found that the picture no change? why... because the cache... just F5 to refresh navigator(IE) then the correct result will show.

    remember to backup your file when you change, because i am not sure it 100% correct

  4. #4
    Constant Pligger cent's Avatar
    Joined
    Jan 2007
    Posts
    180
    Thanks
    Received:0
    Given: 0
    I'm currently doing a private beta test of the image upload module. this update adds in a number of fixes including editing the image when you edit the entry. This should be ready in the next day or 2.

    Best,
    Cent

    Quote Originally Posted by chungbs View Post
    i also have the problem when i using it...
    so i try some ways to fix it

    1) the easy way is change two file at below, but everytime when you edit the story, you must upload the image.

    file : /templates/yget/editlink_edit_center.tpl
    <form action="" method="post" id="thisform">
    change to
    <form action="" method="post" id="thisform" enctype="multipart/form-data">


    file : /editlink.php
    $linkres->store();
    add this line ---> check_actions('image_upload_process');
    header('Location: ' . getmyurl('story', $_POST['id']));



    2) this way is better, don't need to upload image when edit, but more file to change.

    file : /templates/yget/submit_extra_fields.tpl
    <input type="file" name="link_field1" id="link_field1" size="20" class="form-full" />
    add this line ---> <input type="text" name="image_field" id="image_field" value="{$submit_link_field1}" size="60"/>
    </p>


    file : /templates/yget/editlink_edit_center.tpl
    <form action="" method="post" id="thisform">
    change to
    <form action="" method="post" id="thisform" enctype="multipart/form-data">


    file : /editlink.php
    $linkres->link_field1 = trim($_POST['link_field1']);
    change to
    $linkres->link_field1 = trim($_POST['image_field']);
    ...........................
    $linkres->store();
    add this line ---> check_actions('image_upload_process');
    header('Location: ' . getmyurl('story', $_POST['id']));


    file : /modules/image_upload/image_upload_main.php
    $smarty->plugins_dir[] = image_upload_plugins_path;
    add this line ---> if ($_FILES[module_imageupload_filename_field]['name'] != ""){
    // Get the image real name, temp name, submission ID
    ..........................
    $db->query("UPDATE ".table_links." set ".module_imageupload_filename_field."='$destFi le' WHERE link_id='$linkID'");
    }
    add this line ---> }


    when edit finished after submit, you will see the story page, but some time i found that the picture no change? why... because the cache... just F5 to refresh navigator(IE) then the correct result will show.

    remember to backup your file when you change, because i am not sure it 100% correct

  5. #5
    New Pligger chungbs's Avatar
    Joined
    Jun 2007
    Posts
    4
    Thanks
    Received:0
    Given: 0
    oh, that's great, thanks cent

  6. #6
    New Pligger seopro's Avatar
    Joined
    May 2007
    Posts
    24
    Thanks
    Received:0
    Given: 0
    cent could u please post the modifications you made to the image upload module ?

Similar Threads

  1. Image Upload -> Link Image to Story
    By MikeF in forum Questions & Comments
    Replies: 9
    Last Post: 04-11-2011, 03:30 PM
  2. error after editing a story
    By jackpu in forum Questions & Comments
    Replies: 0
    Last Post: 08-12-2008, 08:08 PM
  3. Image Upload - Make image link to story
    By swese44 in forum Questions & Comments
    Replies: 1
    Last Post: 07-22-2008, 06:07 PM
  4. Replies: 3
    Last Post: 02-12-2008, 04:33 AM
  5. Bug when editing a story (URL broken)
    By ablaye in forum Questions & Comments
    Replies: 0
    Last Post: 01-01-2008, 08:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg