Jump to content

Chrisj

Members
  • Posts

    551
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Chrisj

  1. I have this Search Form that works successfully:

    <form method="get" action="../search.php" name="myForm" /> 
    <select size="1" name="channel" class="dropdown_box" /> 
    <option value="All">All</option> 
    <option value="4">Channel-2</option> 
    <option value="6">Channel-4</option> 
    </select> 
    <select size="1" name="sub_category" class="dropdown_box" /> 
    <option value="All">Sub Category</option> 
    </select> 
    <input type="text" autocomplete="off" id="keyword" name="keyword" value="SEARCH WORDS" onfocus="if (this.value=='SEARCH WORDS') {this.value=''; this.style.color='#696969';}" onclick="clickclear(this, 'Search [var.site_name]')" onblur="clickrecall(this,'Search [var.site_name]')" value="" /> <input type="submit" value="SUBMIT"/> 
    </form>
    

    I wanted it to look better, so I installed this JQuery drop-down menu plug-in: 

    http://www.jqueryscript.net/form/Custom-Select-Dropdown-List-Plugin-For-jQuery-jQuery-UI.html1
    And I'm trying to combine them. 
    Here's essentially the jQuery code:

    
    <form action="" method="get">
    <table>
    <tr>
    <td>
    <h3>1. SELECT CATEGORY</h3>
    <select name="drop1" class="ui-select">
    <option value="">Choose One</option>
    <option value="2">ALL</option>
    <option value="4">Channel-2</option>
    <option value="6">Channel-4</option>
    </select>
    </td>
    <td>
    <h3>2. ENTER SEARCH WORDS</h3>
    <select name="drop2" class="ui-select">
    </select>
    </td>
    <td>
    <h3>2. CHOOSE CATEGORY</h3>
    <select name="drop2" class="ui-select">
    </select>
    </td>
    </tr>
    </form>
    
    <script>
    $(document).ready(function(){
    $(".ui-select").selectWidget({
    change       : function (changes) {
    return changes;
    },
    effect       : "slide",
    keyControl   : true,
    speed        : 200,
    scrollHeight : 250
    });
    });
    </script>
    

    I believe it's changing <select> line that I can't get correct.

    I look forward to any assistance.

     

  2. Thank you for all of your replies.

    I've cured the syntax error and added this to uploader.php:

     

    if(isset($_SESSION['channel_id'])) {
     echo '<input type="hidden" name="channel" value="1">';
    } else {
     echo "<select class='upload-video-form-input' name='channel' onchange='javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);'>
      [var.fields_all;htmlconv=no]</select>";
    }
    

    However, I could use some assistance, please, with how to tie it into the Form code:

    <li style="width:240px; text-align:right;"><strong>[var.lang_select_channel]:</strong></li>
    <li style="width:400px; text-align:left;">
    
    <select class="upload-video-form-input" style="width:160px;" size="1" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);">
     [var.fields_all;htmlconv=no]</select> ([var.lang_select_one])</li>
    
    <li style="width:240px; text-align:right"> </li>
    <li style="width:380px" class="font5_14"><strong>[var.lang_sub_categories]</strong></li>
    
    <li style="width:240px; text-align:right"><strong>[var.lang_sub_cat]: </strong></li>
    <li style="width:400px; text-align:left;" id="sub_change"><select class="upload-video-form-input" style="width:160px;" size="1" name="sub_cat"></select> ([var.lang_optional])</li>
    

    Any guidance with how to ultimately adjust the Form so the named the channel "1", can allow the sub-categories to populate the Form, will be greatly appreciated.

  3. In a php video-web-script I'm using, in the (video)Upload Form I tried hiding the select-a-channel drop-down choices, essentially like this:

    <li><input type="hidden" name="channel" value="1"/></li>
    

    (so, that the Channel is pre-determined for the uploader/user).
    But, when the Channel is hidden like that, the next field box(sub-categories) in the Form, shows no choices. Apparently, in this Upload Form a Channel choice is required in order to see the sub-category choices.

    So, I'm trying to figure out a way to name the channel, and somehow let the Form know that Channel has been chosen, so that the sub-category drop-down choices are available for choosing, and proceeding.
    Here's the code without the hidden Channel:

    <li style="width:240px; text-align:right;"><strong>[var.lang_select_channel]:</strong></li>
    <li style="width:400px; text-align:left;">
    
    <select class="upload-video-form-input" style="width:160px;" size="1" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);">
     [var.fields_all;htmlconv=no]</select> ([var.lang_select_one])</li>
    
    <li style="width:240px; text-align:right"> </li>
    <li style="width:380px" class="font5_14"><strong>[var.lang_sub_categories]</strong></li>
    
    <li style="width:240px; text-align:right"><strong>[var.lang_sub_cat]: </strong></li>
    <li style="width:400px; text-align:left;" id="sub_change"><select class="upload-video-form-input" style="width:160px;" size="1" name="sub_cat"></select> ([var.lang_optional])</li>
    

    Someone who looked at the files had this to say (it's a bit over my head):

     

    "the javascript executes uploader.php?sub_cat=1.  
    The uploader.php returns the list of subcategories in html 
    and the ahah script moves it to the correct section on the inner_uploader.htm
    Move the javascript off the onchange to just do it anyway and pass the channel value of 1 directly into uploader.  
    I just think maybe the javascript isn't being executed for whatever reason"
     
    Here's that javascript file:
     
    // ==========================================================================
    
    // @function		Complete AHAH function
    
    // @author		Daniele Florio
    
    // @site		www.gizax.it
    
    // @version		1.1.3 experimental
    
    
    
    // @thanksTo		Andrea Paiola,Walter Wlodarski,Scott Chapman
    
    
    
    // @updated 1.1.3 ( execJS function ) @thanks to Giovanni Zona
    
    
    
    // (c) 2006 Daniele Florio <daniele@gizax.it>
    
    
    
    // ==========================================================================
    
    
    
    /* USAGE:
    
    
    
    1) Posting data to form:
    
    <form id="myform" action="javascript:ahahscript.likeSubmit('helloworld.php', 'post', 'myform', 'mytarget');">
    
    
    
    									    ('comments_ajax.php', 'commentajax', '', 'GET', '', this)
    
    2) Getting simple url
    
    
    
    <a href="#" onclick="javascript:ahahscript.ahah('test.htm', 'mytaget', '', 'GET', '', this);">click me</a>
    
    
    
    */
    
    
    
    var ahahscript = {
    
    
    
    	//loading : 'loading...',
    
    	loading : "<br /><img src=javascripts/loading.gif",
    
    
    
    	ahah : function (url, target, delay, method, parameters) {
    
    
    
    	  if ( ( method == undefined ) || ( method == "GET" ) || ( method == "get" ) ){
    
    
    
    			this.creaDIV(target, this.loading);
    
    
    
    			if (window.XMLHttpRequest) {
    
    				req = new XMLHttpRequest();
    
    			}
    
    			else if (window.ActiveXObject) {
    
    				req = new ActiveXObject("Microsoft.XMLHTTP");
    
    			}
    
    			if (req) {
    
    				req.onreadystatechange = function() {
    
    					ahahscript.ahahDone(url, target, delay, method, parameters);
    
    				};
    
    				req.open(method, url, true);
    
    				req.send("");
    
    			}
    
    		}
    
    		if ( (method == "POST") || (method == "post") ){
    
    
    
    			this.creaDIV(target, this.loading);
    
    
    
    			if (window.XMLHttpRequest) {
    
    				req = new XMLHttpRequest();
    
    			}
    
    			else if (window.ActiveXObject) {
    
    				req = new ActiveXObject("Microsoft.XMLHTTP");
    
    			}
    
    			if (req) {
    
    				req.onreadystatechange = function() {
    
    					ahahscript.ahahDone(url, target, delay, method, parameters);
    
    				};
    
    				req.open(method, url, true);
    
    				req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    
    				req.send(parameters);
    
    			 }
    
    		}
    
    	},
    
    
    
    	creaDIV : function (target, html){
    
    		if (document.body.innerHTML) {
    
    			document.getElementById(target).innerHTML = html;
    
    	   	}
    
    	   	else if (document.getElementById){
    
    			var element = document.getElementById(target);
    
    			var range = document.createRange();
    
    			range.selectNodeContents(element);
    
    			range.deleteContents();
    
    			element.appendChild(range.createContextualFragment(html));
    
    	   }
    
    	},
    
    
    
    	execJS : function (node) {
    
    
    
    		var st = node.getElementsByTagName('SCRIPT');
    
    		var strExec;
    
    
    
    		var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
    
    		var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
    
    		var bMoz = (navigator.appName == 'Netscape');
    
    
    
    		for(var i=0;i<st.length; i++) {
    
    			if (bSaf) {
    
    			  strExec = st[i].innerHTML;
    
    			}
    
    			else if (bOpera) {
    
    			  strExec = st[i].text;
    
    			}
    
    			else if (bMoz) {
    
    			  strExec = st[i].textContent;
    
    			}
    
    			else {
    
    			  strExec = st[i].text;
    
    			}
    
    			try {
    
    			  eval(strExec);
    
    			} catch(e) {
    
    			  alert(e);
    
    			}
    
    		}
    
    
    
    	},
    
    
    
    	ahahDone : function (url, target, delay, method, parameters) {
    
    		if (req.readyState == 4) {
    
    			element = document.getElementById(target);
    
    			if (req.status == 200) {
    
    
    
    				//this.creaDIV(target, req.responseText);
    
    				output = req.responseText;
    
    				document.getElementById(target).innerHTML = output;
    
    				var j = document.createElement("div");
    
    				j.innerHTML = "_" + output + "_";
    
    				this.execJS(j);
    
    
    
    			}
    
    			else {
    
    				this.creaDIV(target, "ahah error:\n"+req.statusText);
    
    			}
    
    		}
    
    	},
    
    
    
    	/*
    
    
    
    	@@ parameters :
    
    	fileName	= name of your cgi or other
    
    	method		= GET or POST, default is GET
    
    	formName	= name of your form
    
    	dynamicTarget	= name of your dynamic Target DIV or other
    
    
    
    	@@ usage :
    
    
    
    
    
    	*/
    
    
    
    	likeSubmit : function ( file, method, formName, target ) {
    
    
    
    		var the_form = document.getElementById(formName);
    
    		var num = the_form.elements.length;
    
    		var url = "";
    
    		var radio_buttons = new Array();
    
    		var nome_buttons = new Array();
    
    		var check_buttons = new Array();
    
    		var nome_buttons = new Array();
    
    
    
    
    
    		// submit radio values
    
    		var j = 0;
    
    		var a = 0;
    
    		for(var i=0; i<the_form.length; i++){
    
    			var temp = the_form.elements[i].type;
    
    			if ( (temp == "radio") && ( the_form.elements[i].checked) ) {
    
    				nome_buttons[a] = the_form.elements[i].name;
    
    				radio_buttons[j] = the_form.elements[i].value;
    
    				j++;
    
    				a++;
    
    			}
    
    		}
    
    		for(var k = 0; k < radio_buttons.length; k++) {
    
    			url += nome_buttons[k] + "=" + radio_buttons[k] + "&";
    
    		}
    
    
    
    		// submit checkbox values
    
    		var j = 0;
    
    		var a = 0;
    
    		for(var i=0; i<the_form.length; i++){
    
    			var temp = the_form.elements[i].type;
    
    			if ( (temp == "checkbox") && ( the_form.elements[i].checked) ) {
    
    				nome_buttons[a] = the_form.elements[i].name;
    
    				check_buttons[j] = the_form.elements[i].value;
    
    				j++;
    
    				a++;
    
    			}
    
    		}
    
    		for(var k = 0; k < check_buttons.length; k++) {
    
    			url += nome_buttons[k] + "=" + check_buttons[k] + "&";
    
    		}
    
    
    
    		// submit all kind of input
    
    		for (var i = 0; i < num; i++){
    
    
    
    			var chiave = the_form.elements[i].name;
    
    			var valore = the_form.elements[i].value;
    
    			var tipo = the_form.elements[i].type;
    
    
    
    			//var valore_2 = valore.replace(/ /,"OK Space"));
    
    			//alert(valore_2);
    
    
    
    			if ( (tipo == "submit") || (tipo == "radio") || (tipo == "checkbox") ){}
    
    			else {
    
    				url += chiave + "=" + valore + "&";
    
    			}
    
    		}
    
    
    
    		//alert(url);
    
    
    
    		var ajax_space_fix = url;
    
    		var intIndexOfExtraSpace = ajax_space_fix.indexOf( " " );
    
    
    
    		while (intIndexOfExtraSpace != -1)
    
    		{
    
    			ajax_space_fix = ajax_space_fix.replace( " ", " " )
    
    			intIndexOfExtraSpace = ajax_space_fix.indexOf( " " );
    
    		}
    
    
    
    		//alert( ajax_space_fix );
    
    
    
    		var parameters = ajax_space_fix; //url;
    
    
    
    		url = file + "?" + url;
    
    
    
    		if (method == undefined) {
    
    			method = "GET";
    
    		}
    
    		if (method == "GET") {
    
    			this.ahah(url, target, '', method, '');
    
    		}
    
    		else {
    
    			this.ahah(file, target, '', method, parameters);
    
    		}
    
    	}
    
    
    
    };
    

    Any ideas regarding naming the channel, and let the Form know that Channel has been chosen, so that the sub-category drop-down choices are available for choosing" will be greatly appreciated.

     
     
     

     

     

  4. Thank you for looking that over. I appreciate it.

    I removed the one of the TWO SEMIS, thanks.

    Yes, I need some guidance with:

    "THINK YOU NEED TO WORK ON THIS"

    "THIS LINE IS DEFINITELY BROKEN. TOO MANY ' AND " CHARS HERE!"

    and with the syntax error. Any guidance you'd like to share will be welcomed.

  5. Thank you for your reply/help.

     

    Yes,I'm looking at uploader.php. Here are lines 19 thru 81

    include_once ('classes/config.php');
    
    include_once ('classes/sessions.php');
    
    include 'uploader_conlib.php';
    
    $config['notification_error'] = $lang_error;
    
    $page_title = $lang_upload_video;
    
    
    if ($_SESSION['user_id'] == "") {
    
    header("Location: $login_out_link");;
    
    die();
    
    }
    
    
    
    $load_javascript = 1;
    
    $ahah = 1;
    
    $thickbox = 1;
    
    
    
    ///////////////////////////////////////////////////////////////////////////////////////
    
    // ADDED SPAMMER UPLOAD TRACKING LOGING
    
    //
    
    
    
    $member_uploading = $_SESSION['user_name'];
    
    $tracking_log_file = 'logs/uploader_log.txt';
    
    $admin_email = $config['admin_notify_email'];
    
    $user_ip = mysql_escape_string($_SERVER['REMOTE_ADDR']);
    
    $referer = mysql_real_escape_string($_SERVER['HTTP_REFERER']);
    
    
    
    if ( $referer == '' ) die_spammer_alerts();
    
    if ( !ereg ($_SERVER['SERVER_NAME'], $referer) ) die_spammer_alerts();
    
    
    
    ///////////////////////////////////////////////////////////////////////////////////////
    
    if(isset($_SESSION['channel_id'])) {
    echo '<input type="hidden" name="channel" value="$_SESSION['channel_id']">';
    } else {
    echo '<select class="upload-video-form-input" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);">
     [var.fields_all;htmlconv=no]</select>';
    }
    
    Any additional help will be appreciated.
  6. Thanks you for your replies. I corrected the echo close, Much appreciated.

    However, I still see this error:

     

     

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/public_html/uploader.php on line 39

     

    and line 39 is blank.

     

    Any additional help will be appreciated.

  7. Thanks for your message.

     

     

    "Parse error: syntax error, unexpected T_CLASS, expecting ',' or ';' in /home/public_html/uploader.php on line 48"

     

     

    line 48 is blank.

     

    The error only appears when I add:

    if(isset($_SESSION['channel_id'])) {
    echo '<input type="hidden" name="channel" value="1">
    } else {
    echo '<select class="upload-video-form-input" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);">
     [var.fields_all;htmlconv=no]</select> ';
    }
    

    to line 83

     

    Any additional help will be greatly appreciated.

  8. In a php video-web-script I'm using, in the (video)Upload Form I tried hiding the select-a-channel drop-down choices, essentially like this:

    <li><input type="hidden" name="channel" value="1"/></li>
    
    (so, that the Channel is pre-determined for the uploader/user).
     
    But, when the Channel is hidden like that, the next field box(sub-categories) in the Form, shows no choices. Apparently, in this Upload Form a Channel choice is required in order to see the sub-category choices.
     
    So, I'm trying to figure out a way to hide the channel, but somehow let the Form know that Channel has been chosen, so that the sub-category drop-down choices are available for choosing, and proceeding.
     
    Here's the code without the hidden Channel:
     
    <li style="width:240px; text-align:right;"><strong>[var.lang_select_channel]:</strong></li>
    <li style="width:400px; text-align:left;">
    
    <select class="upload-video-form-input" style="width:160px;" size="1" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);">
     [var.fields_all;htmlconv=no]</select> ([var.lang_select_one])</li>
    
    <li style="width:240px; text-align:right"> </li>
    <li style="width:380px" class="font5_14"><strong>[var.lang_sub_categories]</strong></li>
    
    <li style="width:240px; text-align:right"><strong>[var.lang_sub_cat]: </strong></li>
    <li style="width:400px; text-align:left;" id="sub_change"><select class="upload-video-form-input" style="width:160px;" size="1" name="sub_cat"></select> ([var.lang_optional])</li>
    

    So, then I tried adding this to the uploader.php file:

    if(isset($_SESSION['channel_id'])) {
    echo '<input type="hidden" name="channel" value="1">
    } else {
    echo '<select class="upload-video-form-input" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);">
     [var.fields_all;htmlconv=no]</select> ';
    }
    

    but got a syntax error.

     

    Any ideas regarding "hide the channel, but somehow let the Form know that Channel has been chosen, so that the sub-category drop-down choices are available for choosing" will be greatly appreciated.

     

  9. I'm trying to add a Member Credit modification to a php file, that works successfully on another site. I'm trying to figure it out as I go, When I add some of the lines of code into the search.php file I see a HTTP Error 500. But when I commented-out these lines:



    //CREDITS MOD
    //--BEGIN--
    $video_price = videoPrice();
    $total_price = $video_price * $total_records;
    $member_credits = get_member_credits($user_id);
    // --END-- 

    the file proceeds successfully. So, obviously I'm missing something. Can you tell me what the function of these lines might be? And maybe what might be needed? Or tell me what these lines might mean? Any help will be appreciated.


  10. In the PHP/SQL script I'm using the search query is only done on one table at a time, currently. I'd like help creating combined search results "All" from the videos table and images table when similar "tags" are searched. Can a Union be used to display just specific, similar columns from each table?
    Currently, the separate 'search results' are displayed the same way. The 'image search results' display an image, title, description, in a results column on the page. The 'video search results' display a thumbnail image, title, description, in a results column on the page. I've attached a shot of the 'images' table and a shot of the 'videos' table. Any guidance will be appreciated.

    post-20454-0-27649400-1466202693_thumb.png

    post-20454-0-35253500-1466202704_thumb.png

  11. Thanks for your reply.

    In the browser, it stays the same ../upload_avatar.php

    When I right-click the blank page to 'view source' I see this:

    "Confirm Form Resubmission

     
    This webpage requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed.
     
    Press the reload button to resubmit the data needed to load the page.
    ERR_CACHE_MIS"
     
     
    Yes, I copied the template and .php file. I know have two places in the script with this Form. The original shows the errors properly, and the new Form only shows "Request has been completed", but a blank page for wrong file size or wrong file type.
     
    So, I'm not clear on what to do next, regarding the missing relative path, or a work around.
    Any additional help will be appreciated.
  12. In the script I'm using, I moved 'upload_avatar.php' and 'inner_upload_avatar.htm' from a Folder into the public_html and public_html/templates folder respectively.

     

    They work successfully there. The only thing I changed on 'upload_avatar.php' was this:

    include_once ('..classes/config.php');
    include_once ('..classes/sessions.php');
    

    to this:

    include_once ('classes/config.php');
    include_once ('classes/sessions.php');
    

    But, the only thing that doesn't work is the unsuccessful messages.

    When an image uploads successfully "Request has been completed" appears. 

    But when I upload a non-image file type, or file too large, I see nothing.

     

    The script before I moved it shows" File dimensions error", or "File type not allowed". I'm stumped as to why those messages don't appear.

     

    I've attached upload_avatar.php. If you could help me figure out why this is the case, or suggest a simple work around, I'd greatly appreciate it. (Also, I know this code is old). Thanks.

     

     

     

     

    upload_avatar.php

  13. With a basic image Upload Form, like the one in the script I'm using:

    <form method="POST" enctype="multipart/form-data" action="upload_avatar.php">
    <input type="hidden" name="security_token" value="[var.security_token]" />
    <p align="center"><font face="Arial"><input type="file" name="img_file" size="20"></font></p>
    <p align="center"><font face="Arial"><input type="submit" value="Submit" name="upload"> <input type="reset" value="Reset" name="B2"></font></p>
    </form>
    

    If I add a 'Title' field, 'Description' field/box, and when the fields are populated and the image is chosen (from the pc), and then the 'Submit' button is selected, can the image get processed by one .php file, and the 'Title', 'Description" text get processed by another .php file, from a single 'Submit' button?

    Is that possible?

  14. I'm using a PHP script which has this Search Form:

         <form method="get" action="search.php" autocomplete="off" name="form_search">
    
            <select size="1" name="type" />
            <option value="videos">[var.lang_word_videos]</option>
            <option value="images">[var.lang_word_images]<!--[onload;block=option;when [var.enable_images]=1;comm]--></option>
        	</select>
    
        	<input autocomplete="off" id="keyword" name="keyword" value="Search [var.site_name]" onclick="clickclear(this, 'Search [var.site_name]')" onblur="clickrecall(this,'Search [var.site_name]')" />
        	<input type="submit" value="Search" />
          </form>
    

    How can I add an "All" option, so it can search both images and videos? Is it simply this?

    <option value="all">All</option>
    

    And then I would need to sync that in the search.php file? Can someone help with that part too?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.