Jump to content

Chrisj

Members
  • Posts

    551
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Chrisj

  1. This Form works on another page on the site. But I'd like a log-in form also on the home page.

    A. I'd like to add this as the submit button:
     

    1.src="images/login.png"
    

    B. And I'd like to remove the options. (But when I remove the "select area" the form won't work).

    Can you help me modify this working form with my above A. & B. requests?

    ]<form action="login.php" method="post" accept-charset="UTF-8" class="middletext">
    <p>
    <style type="text/css">
    .form_label {
    font-size: 100%;
    color: #000000;
    }
    #user_name_login {
    width: 70px;
    }
    #password_login {
    width: 40px;
    }
    </style>
     <label for="user_name_login" class="form_label">     Username </label>
    <input type="text" name="user_name_login" id="user_name_login" size="10" />
    1<label for="password_login" class="form_label">     Password </label>
    <input type="password" name="password_login" size="10" />
    
    <select name="cookie_time"  class="login-field">
                   <option value="1440">[var.lang_1_day]</option>
                  <option value="10080">[var.lang_1_week]</option>
                    <option value="43200">[var.lang_1_month]</option>
                    <option value="-1" selected="selected">[var.lang_forever]</option>
                  </select>
    <input type="submit" value="[var.lang_login_now]" class="button-form" />
    <input type="hidden" name="submitted" value="yes" />
    <input type="hidden" name="remember_me" value="remember_me" />
    <input type="hidden" name="referer_url" value="[var.referer]">
    </p>
    </form>
    


     

  2. I'm using a php script. I received help modding version 1 of the script, which added this single line to the session file:

    $member_credits = get_member_credits($user_id);
    

    As seen here in this version 1 sessions file:

    <?php
    validate_user($_COOKIE['user']);
    
    // set user vars for passing around each php page
    $user_id	= $_SESSION['user_id'];
    $user_name	= $_SESSION['user_name'];
    $user_group = $_SESSION['user_group'];
    
    //get some basic user things like email for logged in members
    if ( $user_id != '' ) {
    
    	$loggedin 			= 1;
    	$login_out 			= $config['logout_text'];
    	$login_out_link 		= 'logout.php';
    	$register_menu 		= $config['fav_menu'];
    	$register_menu_link	= 'myfavorites.php';
    	require_once('functions.inc.php');
    	$member_credits = get_member_credits($user_id);
    	//email inbox
    	$sql			= "SELECT indexer FROM messages WHERE to_id = '$user_id' AND email_read = 'no'";
    	$number_of_emails = @mysql_num_rows(mysql_query($sql));
    	$show_email_count = 1;
    
    	if ( $number_of_emails == '' ) $number_of_emails = 0;
    
    	//Friend Invites
    	$sql = "SELECT * FROM friends WHERE friends_id = '$user_id' AND invitation_status ='pending'";
    	$number_of_invites = @mysql_num_rows(mysql_query($sql));
    	$show_invites_count = 1;
    
    	//show My favs link
    	$show_my_favs 	= 1;
    
    	//show My account link
    	$show_my_account 	= 1;
    
    	//do not show signup link
    	$show_register 	= '';
    
    } else {
    
    	$show_register 	= 1;
    }
    
    ?>
    

    Version 2, which I've upgraded to, has a new session file. Can you please tell me where the appropriate place to add this line:

    $member_credits = get_member_credits($user_id);
    

    intto this new version 2 session file, please?

    ?php
    validate_user($_COOKIE['user']);
    
    // set user vars for passing around each php page
    $user_id	= $_SESSION['user_id'];
    $user_name	= $_SESSION['user_name'];
    $user_group = $_SESSION['user_group'];
    
    $sql		= "SELECT user_id, user_name, account_status FROM member_profile WHERE user_id = '$user_id'";
    $query 		= @mysql_query($sql);
    $outcome		= @mysql_fetch_array($query);
    $result		= $outcome['account_status'];
    $result_user	= $outcome['user_name'];
    
    if ($result_user == '') {
    
    	$user_id				= '';
    	$user_name				= '';
    	$_SESSION['user_id'] 		= NULL;
    	$_SESSION['user_name'] 		= NULL;
    	$_SESSION['user_group'] 	= NULL;
    	$_SESSION['admin_logged']	= NULL;
    
    	@session_start();
    	@session_destroy();
    
    	foreach ( $_COOKIE as $key => $value ) {
         		$logout = '';
        		setcookie($key, $logout);
        	}
        	foreach ($_SESSION as $key => $value) {
       		$_SESSION[$key] 	= NULL;
    		unset($_SESSION[$key]);
    	}
    
    }
    
    if ( $result == 'suspended' ) {
    
    	$user_id				= '';
    	$user_name				= '';
    	$_SESSION['user_id'] 		= NULL;
    	$_SESSION['user_name'] 		= NULL;
    	$_SESSION['user_group'] 	= NULL;
    	$_SESSION['admin_logged']	= NULL;
    
    	@session_start();
    	@session_destroy();
    
    	foreach ( $_COOKIE as $key => $value ) {
         		$logout = '';
        		setcookie($key, $logout);
        	}
        	foreach ($_SESSION as $key => $value) {
       		$_SESSION[$key] 	= NULL;
    		unset($_SESSION[$key]);
    	}
    
    	//account suspended
          $notification_type	= $config['notification_error'];
          $error_message 		= $config['account_suspended'];
          $blk_notification 	= 1;
          $template 			= "themes/$user_theme/templates/main_1.htm";
          $inner_template1		= "themes/$user_theme/templates/inner_notification.htm";
          $TBS 				= new clsTinyButStrong;
          $TBS->NoErr 		= true;
          $TBS->LoadTemplate("$template");
          $TBS->Render 		= TBS_OUTPUT;
          $TBS->Show();
    
    	@mysql_close();
          die();
    }
    
    
    //get some basic user things like email for logged in members
    if ( $user_id != '' ) {
    
    	if ( defined('SMF_INSTALLED') ) {
    		$loggedin 			= 1;
    		$login_out 			= $config['logout_text'];
    		$login_out_link 		= 'logout.php';
    		$register_menu		= $config['fav_menu'];
    	} else {
    		$loggedin 			= 1;
    		$login_out 			= $config['logout_text'];
    		$login_out_link 		= 'logout.php';
    		$register_menu		= $config['fav_menu'];
    	}
    
    	//email inbox
    	$sql				= "SELECT indexer FROM messages WHERE to_id = '$user_id' AND email_read = 'no'";
    	$number_of_emails 	= @mysql_num_rows(mysql_query($sql));
    	$show_email_count 	= 1;
    
    	//Friend Invites
    	$sql 				= "SELECT * FROM friends WHERE friends_id = '$user_id' AND invitation_status ='pending'";
    	$number_of_invites	= @mysql_num_rows(mysql_query($sql));
    	$show_invites_count 	= 1;
    
    	//show My favs link
    	$show_my_favs 		= 1;
    
    	//show My account link
    	$show_my_account 		= 1;
    
    	//do not show signup link
    	$show_register 		= '';
    
    } else {
    
    	$show_register 		= 1;
    }
    
    ?>
    

    Any help will be greatly appreciated.

  3. I'm looking for a little js guidance with this:
    http://www.videojs.com/docs/setup/

    This code I'm currently using plays the video.js player in IOS, IE10 & Chrome, but not IE8 and FF

     

       <script _V_.options.flash.swf = "http://theurl.com/video-js/video.js.swf"
    </script>
    <script videojs.options.flash.swf = "http://theurl.com/video-js/video.js.swf"
    </script>
    <video id="_1200k.mp4" class="video-js vjs-default-skin"
          controls preload="none" width="640" height="264"
          poster="[var.base_url]/[var.thumb_file]"
          data-setup='{"example_option":true}'>
          <source src="http://theurl.com/uploads/Yr7fGNOH0ell3Ml_1200k.mp4" type='video/mp4' />
    </video>

    I'd like help getting it to work in IE8 and FF. Any help will be greatly appreciated.

  4. I replaced a working file, with the same file from another working web site, but the new file generates a HTTP 500 internal server error page.

     

    The only difference in the new page are these lines:

    ///////////////////////////////////////////////////
    $_SESSION['searched'] = $_GET['keyword'];
    $prch = $_GET['p'];
    if ($user_id == "") {
    $new_temp = "themes/$user_theme/search_results1.htm";
    }elseif ($prch == "1") {
    $new_temp = "themes/$user_theme/search_results2.htm";
    }else{
    $new_temp = "themes/$user_theme/search_results.htm";
    }
    

    I'm hoping to learn the reason why these lines might be creating this error.

    Thanks

  5. I'm creating a mobile version of a web site that's using the phpMotion script.
    In the desktop version when Registration link is selected it executes the code in join.php
    and displays inner_signup_form.htm, where visitors register.

    What's the easiest solution when visitors visit the web site, via a mobile device?
    I'm creating a mobile version of the website in a subdomain.
    I'm using GitHub code to redirect mobile users to the subdomain (Mobile Detect PHP).
    Can you suggest some code that I can add to join.php (not in the subdomain) that will
    say: If Mobile Then Go To The Mobile Page Version of inner_signup_form.htm?

     

  6. Has anyone tried PhpMobilizer?

    To show my website on my iPhone, I downloaded the PhpMobilzer program and followed the instructions:

     

    "Create a subdomain called 'm' for your website.

    Upload the files in the m folder to the m subdomain.

    If you would like to automaticaly redirect users to the mobile site if they are accessing it with their phone, add the following to a main include file or your index.php file on your main site.
    require_once('/home/path/to/subdomain/m/mobilize.php');  "

     

    And now my site appears less jumbled than before. So, it is definitely readable on a mobile device now.

    However, there is alot not there, like quite a few background colors, containers and images.

     

    Can you tell me if there is a way to add some modifications, like adding back in some images, and tweaking a few things that have wrapped?

    (I can't find any forum for support of the PhpMobilizer).

     

    Thanks.

     

     

     

  7. I have this Form that works successfully (I know it's not state-of-the-art).
    I simply want to add code to make Contact Name field mandatory.

    I'm not sure if I should post all the code. Can you help me? thanks
     

    <script type="text/javascript">
    function checkemail(){
    var str=document.myform.email_address.value;
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    if (filter.test(str))
    testresults=true;
    else {
    alert("Please input a valid email address!");
    return false;
    }
    if(document.myform.agree.checked!=1) {
    alert("Please check the box to agree to the Terms.");
    return false;
    }
    if(document.myform.ans.value.toLowerCase()!="white") {
    alert("Please answer security question correctly: Black or White?");
    return false;
    }
    return true;
    }
    </script>
    

     

    
    

     

  8. I'm looking for someone familiar with the Phpmotion script, it has a page where a logged-in web visitor can enter a description into a text field, I'd like to add a function to the html page where the web vistor can Browse his pc, select a document file from his computer, and Upload it (into a folder on my server?).

    Additionally help with having a link created of the uploaded document to appear in the serach_results page.

    Please contact me by PM.
  9. Thanks for the replies/help.

    Here is the inner_upload_video-form.htm script page code:

     

    <snip - removed hundreds of lines of 3rd party script>

     

    Please let me know what else I can provide. Thanks again

  10. Thanks for that help.

    Much appreciated.

    In the phpmotion script a logged-in web visitor can enter a Description into a text field, and then proceed to upload a video file (via Browse, Select, Upload). After it's been uploaded, the Video file can be found, from searching on the web site, and the Description appears next to the Video file Thumbnail. I'd like to get help so that the link for the uploaded Document (see initial posting in this thread) appears with the search results: Description and Thumbnail.

    Any additional help will be appreciated.

  11. I'm using a php script(phpmotion), it has a page where a logged-in web visitor can enter a description into a text field, I'd like to add a function to the html page where the web vistor can Browse his computer, Select a document file from his computer, and Upload it (into a folder on my server?).

    What would you recommend?? Can someone help me with coding?

     

    Thanks

     

    p.s. Additionally a link is created of the uploaded document location somehow.

  12. I have a php site and am getting some spam via my registration page although it has a CAPTCHA image.

     

    Some suggested blocking certain countries who they believed were the most notorious spammers.

     

    They directed me to this page:

     

    http://www.asiteaboutnothing.net/c_block-countries.html

     

    where the author suggests code like this:

     

    SetEnvIf CF-IPCountry CN BuzzOff=1
    SetEnvIf CF-IPCountry RU BuzzOff=1
    SetEnvIf CF-IPCountry IN BuzzOff=1
    Order allow,deny
    Allow from all
    Deny from env=BuzzOff
    

     

    A commentor on that page said this;

     

    "wondering how I might be able to do basically the opposite, which would be to set htaccess to only allow visitors from specific countries...would like to restrict it to only US visitors without listing every other country on the planet. My gut says this should work:

     

     

    SetEnvIf CF-IPCountry US IsUSA=1
    Order deny,allow
    Deny from all
    Allow from env=IsUSA
    

    "

     

    Has anyone had success with these types of approaches?

    Do you think this code can block all but the USA. I'd be interested in targeting only usa visitors to my site.

     

    Can you provide some insight or your opinion on this subject?

    Do you have a better solution?

     

    Thanks.

×
×
  • 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.