v3.5.1 beta - Report Bugs or Issues Here

Status
Not open for further replies.

ballevill3616

New Member
Feb 17, 2014
40
0
0
41
Adam writes about his problems, you know where there are still bugs in version 3.5.1 beta I have no problems with deleting files just like I want to delete a file it is bad redirect to the remote server on which the file resides. Regards
 

joelfcarvalho3427

New Member
YetiShare User
Jan 7, 2014
18
0
0
There is a small issue with the download pages. I think this was already happening in v3.5.

_download_page_compare_all.inc.php -> nothing happens when I'm a guest and click the free download image on the bottom. It was supposed to start a counter.

_download_page_compare_timed.inc.php -> I should click on "slow download" and only then the counter would start ticking, but the "slow download" button is replaced by the counter right after the page completes loading. Looking at the code I can see why this happens, but it is wrong and I couldn't change it in a satisfactory way by myself.

Thank you.
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
joelfcarvalho3427 said:
_download_page_compare_all.inc.php -> nothing happens when I'm a guest and click the free download image on the bottom. It was supposed to start a counter.
This isn't a timed download page. So the image at the bottom is just a link to the next page/download.

joelfcarvalho3427 said:
_download_page_compare_timed.inc.php -> I should click on "slow download" and only then the counter would start ticking, but the "slow download" button is replaced by the counter right after the page completes loading. Looking at the code I can see why this happens, but it is wrong and I couldn't change it in a satisfactory way by myself.
I would create a page before this which doesn't have a counter, then it loads this one that starts the counter automatically. You can chain the pages together. Alternatively you should be able to copy it and easily change the javascript to run on click rather than page load.
 

joelfcarvalho3427

New Member
YetiShare User
Jan 7, 2014
18
0
0
_download_page_compare_all.inc.php -> I see... I thought it had a counter. Now unsetting the counter for this page on the backend makes it work ok when I click the free download image.

_download_page_compare_timed.inc.php -> A new download page for this simple purpose is kind of killing a fly with a pistol. But I could use the idea to also add some fancy stuff in the mean while before the download. Chaining pages is a very good feature, thank you.
I was previously able to do as you say alternatively, I changed the javascript code to make it start the timer only after clicking the "slow download" button, and it works well. But there's a "bug". Thats why I said I couldn't change it in a satisfactory way by myself. The bug is that even if you don't click to start the timer, if you wait the 60 seconds and reload the page, you are good for downloading.

I take it that when you set a download page with a timer, even if you don't implement it visually, it will start ticking on the "background" once you load the page. Well, its not a big issue. I'll content myself with the way it is.

Thank you.
 

mastern

New Member
YetiShare User
Apr 24, 2013
56
1
0
adam said:
joelfcarvalho3427 said:
_download_page_compare_all.inc.php -> nothing happens when I'm a guest and click the free download image on the bottom. It was supposed to start a counter.
This isn't a timed download page. So the image at the bottom is just a link to the next page/download.

joelfcarvalho3427 said:
_download_page_compare_timed.inc.php -> I should click on "slow download" and only then the counter would start ticking, but the "slow download" button is replaced by the counter right after the page completes loading. Looking at the code I can see why this happens, but it is wrong and I couldn't change it in a satisfactory way by myself.
I would create a page before this which doesn't have a counter, then it loads this one that starts the counter automatically. You can chain the pages together. Alternatively you should be able to copy it and easily change the javascript to run on click rather than page load.
Hi Adam,

I suggest you to not create a page before which doesn't have a counter, as with a little modification on jquery or js, just a two line of code, everything work like a charm :
Code:
$('body').on('click','#mybutton, function(e) {
// code to start the counter
})
I think it's better to not change the core 'downloadNextPage' already in place. Everyone could make his little tweeak to change the behaviour with jquery/js.

All is already perfect.

Regards,
Maverick
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
sultime3732 said:
Hello,

Display problem in flags add a language.



Cordialement
Thanks for reporting. Fix for the final release due later today.
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
ballevill3616 said:
Re: v3.5.1 beta - Report Bugs or Issues Here

Unread postby alexandreweb123407 » 26 Mar 2014 01:14

adam wrote:

ballevill3616 wrote:And here's another problem with the remote server when you set everything right in the configuration file on the remote server does not work removing and carefully if want to let the master server to delete the file using a link is a redirection error on the remote server if you mix it in the config redirection is working, but when uploading a file is a link to download instead of being the main server in the form www.xxx.com / link to a file is www.s1.xxx.com/link to the file server configuration is set url main option is set to yes



Sorry I don't understand the issue, could you give more information?



I'm tired of talking to Adam who is giving error when deleting via remote server. But he always says it works, so I changed it!!!


replace your code, for me.
delete_file.php

Code: Select all
Code:
    <?php
    /* setup includes */
    require_once('includes/master.inc.php');

    /* setup page */
    define("PAGE_NAME", t("delete_file_page_name", "Delete File"));
    define("PAGE_DESCRIPTION", t("delete_file_meta_description", "Delete File"));
    define("PAGE_KEYWORDS", t("delete_file_meta_keywords", "delete, remove, file"));

    // load file
    $file = null;
    if (isset($_REQUEST['u']))
    {
        // figure out the delete hash
        $deleteHash = '';
        foreach($_REQUEST AS $k=>$item)
        {
            if(strlen($k) == 32)
            {
                $deleteHash = $k;
            }
        }

        // only keep the initial part if there's a forward slash
        $shortUrl = current(explode("/", str_replace("~d", "", $_REQUEST['u'])));
        $file = file::loadByShortUrl($shortUrl);

        // check it's active
        if($file->deleteHash != $deleteHash)
        {
            $file = null;
        }
    }

    // do we have a return page
    $returnAccount = false;
    if((isset($_REQUEST['returnAccount'])) && ((int)$_REQUEST['returnAccount'] == 1))
    {
        $returnAccount = true;
    }

    /* load file details */
    if(!$file)
    {
        /* if no file found, redirect to home page */
        redirect(WEB_ROOT . "/index." . SITE_CONFIG_PAGE_EXTENSION);
    }

    /* delete file if submitted */
    if ((int) $_REQUEST['delete'])
    {
        // reomve file
        $file->removeByUser();

        // redirect to confirmation page
        $resultMsg = t('file_permanently_removed', 'File permanently removed.');
        if($file->errorMsg)
        {
            $resultMsg = $file->errorMsg;
        }
       
        if($returnAccount)
        {
            redirect(CORE_WEB_ROOT.'/account_home.'.SITE_CONFIG_PAGE_EXTENSION.'?s='.urlencode($resultMsg));
        }
       
        redirect(CORE_WEB_ROOT . "/error." . SITE_CONFIG_PAGE_EXTENSION.'?e='.urlencode($resultMsg));
    }

    // get file path
    $filePath = file::getFileDomainAndPath($file->id);

    require_once('_header.php');
    ?>

    <div class="contentPageWrapper">

        <?php
        if (isErrors())
        {
            echo outputErrors();
        }
        ?>

        <!-- delete file form -->
        <div class="pageSectionMain ui-corner-all">
            <div class="pageSectionMainInternal">
                <div id="pageHeader">
                    <h2><?php echo t("delete_file", "Delete File"); ?></h2>
                </div>
                <div>
                    <p class="introText">
                        <?php echo t("delete_file_intro", "Please confirm whether to delete the file below. Note: Once deleted, this file is removed from our servers and can not be recovered."); ?>
                        <br/><br/>
                    </p>
                    <form class="international" method="post" action="<?php echo $file->getDeleteUrl($returnAccount, true); ?>" id="form-join" AUTOCOMPLETE="off">
                        <ul>
                            <li class="field-container">
                                <?php echo t('file', 'File'); ?>: <a href="<?php echo _CONFIG_SITE_PROTOCOL; ?>://<?php echo $filePath; ?>/<?php echo $file->shortUrl; ?>" target="_blank"><?php echo $file->originalFilename; ?></a> (<?php echo formatSize($file->fileSize); ?>)
                            </li>
                            <li class="field-container">
                                <span class="field-name"></span>
                                <input name="delete" type="hidden" value="1"/>
                                <input name="submitme" type="hidden" value="1"/>
                                <input name="returnAccount" type="hidden" value="<?php echo (int)$returnAccount; ?>"/>
                                <input tabindex="99" type="submit" name="submit" value="<?php echo t("delete_file", "Delete File"); ?>" class="submitInput" />
                                <input tabindex="100" type="reset" name="reset" value="<?php echo t("cancel", "Cancel"); ?>" class="cancelInput" onClick="window.location='<?php echo $returnAccount?(CORE_WEB_ROOT.'/account_home.'.SITE_CONFIG_PAGE_EXTENSION):WEB_ROOT; ?>';" />
                            </li>
                        </ul>
                    </form>

                    <div class="clear"></div>
                </div>
            </div>
        </div>
        <?php include_once("_bannerRightContent.inc.php"); ?>
        <div class="clear"><!-- --></div>
    </div>

    <?php
    require_once('_footer.php');
    ?>
alexandreweb123407

Posts: 15
Joined: 31 Dec 2013 17:06


Adam as you can see not only I have this problem may specifically have a look at this problem?
The delete issue should be fixed now. It'll be in the release later today. To patch it you can remove these lines from delete_file.php, they're not required any more:

Code:
// make sure we're on the correct server for deletes
if($file->getFullShortUrl(true) != $file->getFullShortUrl())
{
    redirect($file->getDeleteUrl($returnAccount, true));
}
 
Status
Not open for further replies.