Web Analytics Made Easy -
StatCounter delay the user when he ask to download attachments ? - CodingForum

Announcement

Collapse
No announcement yet.

delay the user when he ask to download attachments ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • delay the user when he ask to download attachments ?

    i have forum VBulletin , i want to delay the user when he ask to download attachments ,, already upload in my forum root
    like this demand

    javascript - How can I make a 10 second countdown timer before a download button link appears? - Stack Overflow

    my web site : Forums -

  • #2
    Code:
    <script>
    function download() {
    	var x = document.getElementById("the_button");
    	x.value = "Please Wait";
    	x.setAttribute("onclick", "");
    	var int = setInterval(function(){
    	x.value = "Press for Attachments";
    	x.setAttribute("onclick", "alert('Download code goes on this line')");
    	clearInterval(int);
    	}, 10000);
    }	
    </script>
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.

    Comment


    • #3
      Originally posted by sunfighter View Post
      Code:
      <script>
      function download() {
      	var x = document.getElementById("the_button");
      	x.value = "Please Wait";
      	x.setAttribute("onclick", "");
      	var int = setInterval(function(){
      	x.value = "Press for Attachments";
      	x.setAttribute("onclick", "alert('Download code goes on this line')");
      	clearInterval(int);
      	}, 10000);
      }	
      </script>
      were and how can i add in my forum

      URL

      Comment


      • #4
        Javascript is ALWAYS place just before the </body> tag. Better make sure your HTML looks like this:
        <input type="button" id="the_button" onclick="download();" value="Let Me Download">
        Evolution - The non-random survival of random variants.
        Physics is actually atoms trying to understand themselves.

        Comment


        • #5
          Originally posted by sunfighter View Post
          Javascript is ALWAYS place just before the </body> tag. Better make sure your HTML looks like this:
          <input type="button" id="the_button" onclick="download();" value="Let Me Download">
          i m not find ,, more clarification , attached screen from my VBuletin Forum ver. 5 and my Templates , please were can i put the Javascript to hide for a second after click or redirect to waiting page for a second


          1: contententry_panel_attachments

          Code:
          <vb:comment>
          	// Template parameters:
          	// @todo - document all parameters this template accepts
          	@param string uploadFrom - indicates where upload is coming from (for Gallery and Attachments panel only).
          </vb:comment>
          
          <vb:if condition="empty($editPost) OR empty($conversation['attachcount'])">
          	{vb:set hideAttachments, 1}
          <vb:else />
          	{vb:set hideAttachments, 0}
          </vb:if>
          
          <vb:if condition="empty($editPost) OR empty($conversation['attachcount'])">
          	{vb:set attachCount, 0}
          <vb:else />
          	{vb:set attachCount, {vb:raw conversation.attachcount}}
          </vb:if>
          
          <div class="b-content-entry-panel__content b-content-entry-panel__content--attachment h-clearfix h-hide" data-class="b-content-entry-panel__content--attachment">	
          
          	<div class="b-file-chooser">
          		<label class="b-button b-button--upload js-button" tabindex="0">
          			<span class="js-upload-label">{vb:phrase upload_attachments}</span>
          			<input type="file" name="files" multiple="multiple" class="b-form-input__file--hidden" />
          		</label>
          		<button type="button" class="b-button js-upload-from-url">{vb:phrase upload_from_url}</button>
          		<span class="b-form-input__upload-progress js-upload-progress h-hide"></span>
          		<vb:comment>@TODO: no way to fetch the list of valid filetypes per usergroup yet <span class="b-file-chooser__text b-file-chooser__text--filetypes h-margin-left-l">{vb:phrase allowed_filetypes}: </span></vb:comment>
          	</div>
          	<div class="js-attach-postdata"></div>
          	<div class="js-attach-list{vb:if "$hideAttachments", " h-hide"}" data-attach-count="{vb:raw attachCount}">
          			{vb:template contententry_panel_attachments_item, isSample=1}
          			<vb:if condition="!empty($editPost)">
          				<vb:each from="conversation.attach" value="attachment">
          					{vb:template contententry_panel_attachments_item, attachment={vb:raw attachment}}
          				</vb:each>
          			</vb:if>
          	</div>
          	<input type="hidden" name="uploadFrom" value="{vb:raw uploadFrom}" class="js-uploadFrom" />	
          	<span class="b-icon b-icon__x-circle--dark js-contententry-panel-x js-link" tabindex="0">x</span>
          </div>
          2: contententry_panel_attachments_item

          Code:
          <div class="b-attach-item js-attach-item h-margin-top-xl{vb:if "$isSample", " h-hide js-attach-item-sample"}" data-fileext="{vb:raw attachment.extension}" data-filename="{vb:raw attachment.filename}" data-filedataid="{vb:raw attachment.filedataid}" data-attachnodeid="{vb:raw attachment.nodeid}">
          	<div class="b-attach-item__thumb js-attach-item-image h-margin-right-xl h-left">
          		<vb:if condition="!empty($attachment['filedataid'])">
          			<vb:comment>Keep this code in sync with the fileupload.js attachDone method</vb:comment>
          			{vb:set extensionLower, {vb:php strtolower, {vb:raw attachment.extension}}}
          			<vb:if condition="in_array($extensionLower, array('gif', 'jpg', 'jpeg', 'jpe', 'png', 'bmp'))">
          				{vb:set isImage, 1}
          			<vb:else />
          				{vb:set isImage, 0}
          			</vb:if>
          			<vb:if condition="$isImage">
          				<img class="b-attach-item__image" src="filedata/fetch?type=thumb&amp;filedataid={vb:raw attachment.filedataid}" />
          			<vb:else />
          				<span class="b-icon b-icon__doc--gray h-margin-bottom-m"></span>
          			</vb:if>
          		</vb:if>
          	</div>
          	<div class="b-attach-item__controls">
          		<vb:if condition="$isImage OR $isSample">
          			<span data-action="insert_label" class="js-attach-ctrl h-margin-right-s h-left">{vb:phrase insert}:</span>
          			<span data-action="insert" class="b-link js-attach-ctrl h-margin-right-m h-left" tabindex="0">{vb:phrase insert_thumbnail}</span>
          			<span data-action="insert_image" data-imagesize="small" class="b-link js-attach-ctrl h-margin-right-m h-left" tabindex="0">{vb:phrase insert_small}</span>
          			<span data-action="insert_image" data-imagesize="medium" class="b-link js-attach-ctrl h-margin-right-m h-left" tabindex="0">{vb:phrase insert_medium}</span>
          			<span data-action="insert_image" data-imagesize="large" class="b-link js-attach-ctrl h-margin-right-m h-left" tabindex="0">{vb:phrase insert_large}</span>
          			<span data-action="insert_image" data-imagesize="full" class="b-link js-attach-ctrl h-margin-right-m h-left" tabindex="0">{vb:phrase insert_fullsize}</span>
          		<vb:else />
          			<span data-action="insert" class="b-link js-attach-ctrl h-margin-right-m h-left" tabindex="0">{vb:phrase insert}</span>
          		</vb:if>
          		<span data-action="remove" class="b-link js-attach-ctrl h-margin-right-m h-left" tabindex="0">{vb:phrase remove}</span>
          		&nbsp;
          	</div>
          	<div class="b-attach-item__filename js-attach-item-filename">{vb:var attachment.filename}</div>
          	<div class="h-clearfix"></div>
          	<vb:if condition="!$isSample">
          		<vb:comment>If we add these here the attachments will be attached twice.
          		<input type="hidden" name="filedataids[]" value="{vb:raw attachment.filedataid}" />
          		<input type="hidden" name="filenames[]" value="{vb:raw attachment.filename}" />
          		</vb:comment>
          	</vb:if>
          </div>

          Comment


          • #6
            up please

            Comment

            Working...
            X