Jump to content

Chrisj

Members
  • Posts

    551
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Chrisj

  1. I'm using a popular php video-sharing script for my web site. I've modded it so vistors must pay to view a video, however the path to the thumbnail appears on the html page in the View Source code, which is very similar to the path to the actual video. Is there any way to hide the path code?
  2. Thanks for all of the replies. I can't replace my original page of code with your suggested page of code. I wouldn't know where the syntax is incorrect, or how to fix it. Regarding this line of code: $sql = "SELECT * FROM credits ORDER BY user_name ASC"; I replaced it where instructed, refreshed the page and the users were not in alphabetical order. Any other help will be appreciated.
  3. Thanks for that clarification. I will change the line of code, as per your instructions, thanks. However, there is no "actual field name that holds the username's in your credits table". In member_profile there is "user_name". Being I'm not so versed in phpadmin, can you tell me how/where to add user_name to the credits table, please? Thanks again.
  4. Thanks for your reply. Do I now go to phpmyadmin > My database > go to members_credit table and choose SQL tab and enter: $sql = "SELECT * FROM credits ORDER BY user_name ASC"; And then select "Go"? Or is there more to it? Thanks.
  5. This php page called member_credits.php allows the admin to edit the credits on account of the member. It automatically adds the registered member's user name to the list, but it adds the member in order of who registers next. When this list gets long it will be hard to search for members to edit their credits, if needed. Is there a way to add some code so that members are listed (or sorted) alphabetically? Thanks. <?php /// - Database Information $dbhost = 'localhost'; $dbuser = 'dbase_user'; $dbpass = 'xxxxx'; $dbname = 'dbase_name'; /// - Do Not Edit Below This Line $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname); ///////////////////////////////////////////////////////////////////////////////////////// $sql = "SELECT * FROM credits ORDER BY user_id"; $query = mysql_query($sql, $conn) or DIE(mysql_error()); //////////////////////////////////////////////////////////////////////////////////////// // FUNCTIONS //////////////////////////////////////////////////////////////////////////////////////// function getUsername($id) { $sql1 = "SELECT * FROM member_profile WHERE user_id = $id"; $query1 = mysql_query($sql1) or DIE(mysql_error()); $result = mysql_fetch_array($query1); return $result['user_name']; } //////////////////////////////////////////////////////////////////////////////////////// // Edit Members Credits //////////////////////////////////////////////////////////////////////////////////////// // edit members credits $uid = $_GET['id']; if (isset($uid)) { $sql = "SELECT total_credits FROM credits WHERE user_id = $uid"; $return = mysql_fetch_array(mysql_query($sql)); echo "<center><h1>Update ".getUsername($uid)."'s Credits</h1>"; echo "<form action=\"member_credits.php\" method=\"post\">"; echo "<input type=\"hidden\" name=\"user_id\" value=\"{$uid}\">"; echo "<input type=\"text\" name=\"new_credits\" value=\"{$return['total_credits']}\">"; echo "<input type=\"submit\" name=\"submitted\" value=\"Update\"></form></center>"; die(); } // Member Updated $update = $_POST['new_credits']; if (isset($update)) { $user = $_POST['user_id']; $sql = "UPDATE credits SET total_credits=$update WHERE user_id = $user"; $query = mysql_query($sql) or DIE(mysql_error()); if ($query) { echo "<center>Success! ".getUsername($user)." has been updated."; echo "Click <a href=\"member_credits.php\">HERE</a> to return to list</center>"; die(); }else{ echo "There was a problem."; die(); } } ?> <html> <head> <title>Members Credits</title> </head> <body> <center> <H1>Members Credits</h1> <table border="1" bordercolor="#000000"> <tr> <td><b>user</b></td> <td><b>credits</b></td> <td><b>edit</b></td> </tr> <? while($row = mysql_fetch_array($query)) { echo "<tr><td>".getUsername($row['user_id'])."</td>"; echo " <td>".$row['total_credits']."</td>"; echo " <td><a href=member_credits.php?id=".$row['user_id'].">Edit Credits</a></td>"; echo "</tr>"; } ?> </table> </center> </body> </html> <? mysql_close($conn); ?>
  6. The file that contains the header and footer is main.htm
  7. Thanks. To reply: /home/public_html/payment/classes/config.php does not exist. ../ 's or just put the full path from public html - this showed no errors, but also no header/footer. Any other suggestions. Thanks.
  8. I have header and footer showing on most web pages, but not this one added later. I tried copying a few lines from another page that HAS the header and footer appearing, but got many errors which I've listed below. (The page code shown below I've extracted some lines of private data) Any help with trying to add header and footer to it will be appreciated. Working page without header/footer: <?php // Get Details $amount = $_POST['valu']; $credits = $_POST['cre']; $user_id = $_POST['uid']; $item_name = $_POST['itnm']; // Include the paypal library include_once ('Paypal.php'); // Create an instance of the paypal library $myPaypal = new Paypal(); // Specify your paypal email // Specify the url where paypal will send the user on success/failure // Specify the url where paypal will send the IPN // Specify the product information $myPaypal->addField('item_name', $item_name); $myPaypal->addField('amount', $amount); $myPaypal->addField('item_number', $credits); // Specify any custom value $myPaypal->addField('custom', $user_id); // Enable test mode if needed ///$myPaypal->enableTestMode(); // Go $myPaypal->submitPayment(); Added some lines from other page that has header/footer as an attempt, but got errors: <?php (include_once ('classes/config.php'); (include_once ('classes/sessions.php'); // Get Details $amount = $_POST['valu']; $credits = $_POST['cre']; $user_id = $_POST['uid']; $item_name = $_POST['itnm']; // Include the paypal library include_once ('Paypal.php'); // Create an instance of the paypal library $myPaypal = new Paypal(); // Specify your paypal email // Specify the url where paypal will send the user on success/failure // Specify the url where paypal will send the IPN // Specify the product information $myPaypal->addField('item_name', $item_name); $myPaypal->addField('amount', $amount); $myPaypal->addField('item_number', $credits); // Specify any custom value $myPaypal->addField('custom', $user_id); // Enable test mode if needed ///$myPaypal->enableTestMode(); // Go $myPaypal->submitPayment(); The errors were: Warning: include_once(classes/config.php) [function.include-once]: failed to open stream: No such file or directory in /home/public_html/payment/thispage.php on line 3 Warning: include_once() [function.include]: Failed opening 'classes/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/public_html/payment/thispage.php on line 3 Warning: include_once(classes/sessions.php) [function.include-once]: failed to open stream: No such file or directory in /home/public_html/payment/thispage.php on line 4 Warning: include_once() [function.include]: Failed opening 'classes/sessions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/public_html/payment/thispage.php on line 4 Any help/thoughts/suggestions will be appreciated.
  9. Is there a way to Search PHPfreaks by user name only? When I try it asks for search words.
  10. I'm working with a php script that has a form for uploading video files. One of the choices in the form is to choose a "channel". I'd like help in changing this, so the user doesn't have to choose, it's always the same channel choice. I was given some advice, but I could use some more information. Here is the existing code that i'd like to change. And below that is the advice I was given. <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> The advice: "You need to remove the select input, and add this type of hidden input: <input type="hidden" name=" Can someone help me create the right replacement code, so it will hidden and automatically choose a single channel? Thanks.
  11. I'd like to change the color of this one word that appears at: [var.lang_edit_profile]. How do I add font color to this line: <li><strong><!--[onload_829;block=li;when [var.profile_menu]=1;comm]--><a href="[var.base_url]/edit/editprofile.php?id=[var.member_id]" rel="gb_page_center[870, 450]">[var.lang_edit_profile]</a> </strong></li> Thanks
  12. Thanks for your reply. If I add $ip = $_SERVER[REMOTE_ADDR]; to my registration page and add a corresponding field in my database, this will allow me to capture the IP address of the regisrtant? Should the db field be named REMOTE_ADDR ? Obviously I could use some more information. Any additional enlightening would be appreciated.
  13. I'm using a php script for my web site which has registration, log-in, etc. Can you tell me how I might be able to capture the registrants IP adress upon registration? Thanks.
  14. Thanks for your reply. Here is the page of code: <?php session_start(); //CHECK IF FORM SUBMITTED if ($_POST['submitted'] == 'yes') { $pages = $_POST['id']; if (!isset($_POST['id'])) { echo "<script>document.location.href='index.php'</script>"; die(); } $skey = $_SESSION['searched']; if ($_POST['user_id'] != "") { $member_id = $_POST['user_id']; } if ($_POST['ttl'] != "") { $total = $_POST['ttl']; } } foreach ($pages as $vid) { $my_db_info[] = $vid; } include_once ('classes/config.php'); include_once ('classes/functions.inc.php'); $member_credits = get_member_credits($member_id); $balance = $member_credits - $total; if ($member_credits >= $total && $balance >= 0) { for( $x = 0; $x < sizeof( $my_db_info ); ++$x) { $sql = "INSERT INTO credits_temp ( mem_id, vid_id ) VALUES ( $member_id, $my_db_info[$x] )"; $query = @mysql_query($sql); } $sql1 = "UPDATE credits SET total_credits=$balance where user_id=$member_id"; //subtract credits $query1 = mysql_query($sql1); if ($query1 && $query) { $result = "Success! Payment Complete!<br><br>"; $rlink = "search.php"; //$rlink = "search.php?".$slink; $rtitle = "Go To Display"; }else{ $result = "There was a problem processing your request. Try again later or"; $rlink = "page.php?page=2"; $rtitle = "Contact Support"; } } else{ $error = "You do not have enough credits. To purchase credits, "; $rlink = "credits.php"; $rtitle = "Click Here"; } $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_buy.htm"; //middle of page $TBS = new clsTinyButStrong; $TBS->NoErr = true; // no more error message displayed. $TBS->LoadTemplate("$template"); $TBS->MergeBlock('mp', $members_full); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); /* // show "nothing to show" empty arrays if (empty($result_featured)) { $show_v = 1; } else { $show_v = 2; } // display results $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_buy.htm"; //middle of page $TBS = new clsTinyButStrong; $TBS->NoErr = true; // no more error message displayed. $TBS->LoadTemplate("$template"); $TBS->MergeBlock('blkfeatured', $result_featured); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); */ ?>
  15. Enable html is probably good advice, but I don't know what in particular to do with that in regard to my request for help.
  16. Thank you for your reply, but your suggestion appears on the web page like this: Success! Payment Complete! <br><br> Any other suggestions, would be appreciated.
  17. Thanks for that reply. I tried this: $result = "Success! Payment Complete!"<br><br>; and I tried this: $result = "Success! Payment Complete!"; <br><br> $rlink = "search.php"; //$rlink = "search.php?".$slink; $rtitle = "Go To Display"; Both were unsuccessful.
  18. In this if/else function (below), how can I put some space between "Success! Payment Complete!" and "Go To Display". When it shows up on the web page those two lines are stacked right on top of each other. How do I put some space between them? Thanks if ($query1 && $query) { $result = "Success! Payment Complete!"; $rlink = "search.php"; //$rlink = "search.php?".$slink; $rtitle = "Go To Display"; }else{ $result = "There was a problem processing your request. Try again later or"; $rlink = "page.php?page=2"; $rtitle = "Contact Support"; } }
  19. On a page in a php script users are given a choice to choose which Channel thye want. I'd like to change this so the user choice is always the same and chosen automatically and hidden on the page. So the user basically skips this part. I asked a similar question somewhere else and was directed to "remove the select input, and add a hidden input. But I don't know how to do. This is the code, that shows choices, that I'd like to change to a hidden choice. Any help will be appreciated. Thanks. <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>
  20. Thanks for that idea. I tried it unsuccessfully. There were many Warnings on the page.
  21. I need a basic form to submit for a php web page. Can you provide one with a two seperate fields, one text area and a submit button? Thanks
  22. I had help adding a paypal function to a php script I'm using. This help included adding a php page to the original script. This page, when displayed, doesn't show the header and footer like most of the pages do. When I asked how to make the header and footer appear on the new page I was told "you'll have to add the html in to the appropriate places". So, I'm hoping someomnje can help me with the code needed. I'm posting the new paypal page and also a original page that shows the header and footer. Can you direct me to the correct code from orginal page that I can add to the new page so the header and footer will show on the new page, please? Thanks New Page: <?php include_once ('classes/config.php'); // Get User Details $amount = $_POST['valu']; $credits = $_POST['cre']; $user_id = $_POST['uid']; // Include the paypal library include_once ('Paypal.php'); // Create an instance of the paypal library $myPaypal = new Paypal(); // Specify your paypal email $myPaypal->addField('business', 'admin@mywebsite.com'); // Specify the currency $myPaypal->addField('currency_code', 'USD'); // Specify the url where paypal will send the user on success/failure $myPaypal->addField('return', 'http://mywebsite.com/payment/paypal_success.php'); $myPaypal->addField('cancel_return', 'http://mywebsite.com/payment/paypal_failure.php'); // Specify the url where paypal will send the IPN $myPaypal->addField('notify_url', 'http://mywebsite.com/payment/paypal_ipn.php'); // Specify the product information $myPaypal->addField('item_name', 'Account Credits'); $myPaypal->addField('amount', $amount); $myPaypal->addField('item_number', $credits); // Specify any custom value $myPaypal->addField('custom', $user_id); // Enable test mode if needed ///$myPaypal->enableTestMode(); $myPaypal->submitPayment(); Original Page: <?php error_reporting(0); include_once ('classes/config.php'); include_once ('classes/sessions.php'); $default_album_pic = $config['default_album_pic']; /////////////////////////////////////////////////////////////////////////////////////// // changed search server method to get to get rid of cache expired error if( ( $_SERVER['REQUEST_METHOD'] != 'GET') ) dieNice(); $_SESSION['searched'] = $_GET['keyword']; $prch = $_GET['p']; if ($user_id == "") { $new_temp = "themes/$user_theme/templates/search_results_guest.htm"; }elseif ($prch == "1") { $new_temp = "themes/$user_theme/templates/search_results_paid.htm"; }else{ $new_temp = "themes/$user_theme/templates/search_results.htm"; } $queryString = strtolower($_SERVER['QUERY_STRING']); if (strstr($queryString,'%20union%20') OR strstr($queryString,'/*')) dieNice(); $referer = mysql_real_escape_string( $_SERVER['HTTP_REFERER'] ); if ( $referer == '' ) dieNice(); if ( !ereg ($_SERVER['SERVER_NAME'], $referer) ) $flag_stop++; if ( !ereg ($base_url, $referer) ) $flag_stop++; if ( $flag_stop == 2 ) dieNice(); $keywords = $_GET['keyword']; $keywords = str_replace('&#039;s', "", $keywords); //$keywords2 = $_GET['keyword']; $debug_log_file = 'logs/search_log.txt'; if (@file_exists($debug_log_file)) { $fo = @fopen($debug_log_file, 'a'); @fwrite($fo, $keyword); @fclose($fo); } else { $fo = @fopen($debug_log_file, 'w'); @fwrite($fo, $keyword); @fclose($fo); } $keyword = mysql_real_escape_string($keywords); $type = mysql_real_escape_string( $_GET['type'] ); if ($type == '') { $keyword = mysql_real_escape_string($keywords); $type = mysql_real_escape_string($_GET['type']); } if ($keyword == '' | $type == '' ) { $type = 'videos'; $keyword = 'none'; } $get_type = $type; switch ( $get_type ) { case 'videos'; $type_videos = 1; $row_id = 'video_id'; $media_comments = 'videocomments'; $type_query_rows = 'indexer, video_id, title, title_seo, date_uploaded, user_id, video_length, approved, public_private, description, tags, number_of_views'; break; } $query_get_type = $get_type; if ( $query_get_type == 'groups' ) { $query_get_type = 'group_profile'; $page_guery = "SELECT indexer FROM $query_get_type WHERE (group_name like '%$keyword%' or group_description like '%$keyword%')"; $search_query = "SELECT $type_query_rows FROM $query_get_type WHERE (group_name like '%$keyword%' or group_description like '%$keyword%') LIMIT "; // $set_limit, $limit"; } else { $tag_cloud = make_tag_cloud( $get_type ); $tag_cloud_block = $tag_cloud[1]; $page_guery = "SELECT indexer FROM $query_get_type WHERE approved = 'yes' AND public_private = 'public' and (title like '%$keyword%' or tags like '%$keyword%' or description like '%$keyword%')"; $search_query = "SELECT $type_query_rows FROM $query_get_type WHERE approved = 'yes' AND public_private = 'public' and (title like '%$keyword%' or tags like '%$keyword%' or description like '%$keyword%') LIMIT "; // $set_limit, $limit"; } if ( $query_get_type == 'group_profile' ) { $limit = (int) mysql_real_escape_string( $config['search_page_limits'] ); $pagination = pagination($page_guery, $limit); $set_limit = $pagination[0]['set_limit']; $total_pages = $pagination[0]['total_pages']; $current_page = $pagination[0]['current_page']; $total_records = $pagination[0]['total_records']; $next_page = $pagination[0]['next_page']; $prev_page = $pagination[0]['prev_page']; $nl = $pagination[0]['nl']; $pl = $pagination[0]['pl']; $results_of = $current_page * $limit; $results_show = $set_limit + 1; if ( $results_of > $total_records ) $results_of = $total_records; if ( $set_limit == 0 ) $results_show = 1; if ( $total_records == 0 ) $results_show = 0; //define($get_type, true); // TODO // /* add group rating to search display re-write the 3 queries below using 1 JOIN query */ // END // $sql = $search_query . $set_limit .','. $limit; $query = @mysql_query($sql); while ($result = @mysql_fetch_array($query)) { $group_id = $result['indexer']; $sql2 = "SELECT indexer, video_id FROM group_videos WHERE group_id = $group_id AND video_status = 'active'"; $query2 = @mysql_query($sql2); $count_group_videos = @mysql_num_rows($query2); //get group video thumbnail if ($count_group_videos == 0) { $video_picture = 'default_no_group_video'; $group_video_id = 0; } else { $result2 = @mysql_fetch_array($query2); $group_video_id = mysql_real_escape_string($result2['video_id']); $sql0 = "SELECT indexer, video_id FROM videos WHERE indexer = $group_video_id"; $query0 = @mysql_query($sql0); $result0 = @mysql_fetch_array($query0); $group_video_image = $result0['video_id']; $video_picture = $result0['video_id']; $group_video_id = $result0['indexer']; } $video_array = array('video_picture' => $video_picture, 'group_video_id' => $group_video_id); $sql3 = "SELECT indexer FROM group_membership WHERE group_id = $group_id"; $query3 = @mysql_query($sql3); $count_group_members = @mysql_num_rows($query3); $sql4 = "SELECT member_username, member_id FROM group_membership WHERE group_id = $group_id AND group_admin = 'yes'"; $query4 = @mysql_query($sql4); $result4 = @mysql_fetch_array($query4); $admin_username = $result4['member_username']; $group_other_info = array('group_videos' => $count_group_videos, 'group_members' => $count_group_members, 'admin_username' => $admin_username); //merge arrays $group_array = @array_merge($result, $group_other_info, $video_array); $mygroups[] = $group_array; } } if ( $type == 'videos' || $type == 'audios' || $type == 'images' || $type == 'blogs' ) { $limit = (int) mysql_real_escape_string( $config['search_page_limits'] ); $pagination = pagination($page_guery, $limit); $set_limit = $pagination[0]['set_limit']; $total_pages = $pagination[0]['total_pages']; $current_page = $pagination[0]['current_page']; $total_records = $pagination[0]['total_records']; $next_page = $pagination[0]['next_page']; $prev_page = $pagination[0]['prev_page']; $nl = $pagination[0]['nl']; $pl = $pagination[0]['pl']; $result_search = array(); $sql = $search_query . $set_limit .','. $limit; $query = @mysql_query($sql); $results_of = $current_page * $limit; $results_show = $set_limit + 1; if ( $results_of > $total_records ) $results_of = $total_records; if ( $set_limit == 0 ) $results_show = 1; if ( $total_records == 0 ) $results_show = 0; define($get_type, true); while ($result1 = @mysql_fetch_array($query)) { $media_id = mysql_real_escape_string($result1['indexer']); $sql2 = "SELECT indexer FROM $media_comments WHERE $row_id = $media_id"; $query2 = @mysql_query($sql2); $comments_number = @mysql_num_rows($query2); $comments_array = array('comments' => $comments_number); $id = $media_id; if ( $get_type == 'videos' ) { $stars_array = stars_array($media_id); } else { include ('stars_include.php'); $stars_array = array('star1' => $star1,'star2' => $star2,'star3' => $star3, 'star4' => $star4,'star5' => $star5); } // we need dynamic media image query $result_image = $get_type; switch ( $result_image ) { case 'audios'; $pic_sql = "SELECT album_picture FROM audio_albums WHERE album_id = '$media_id' LIMIT 1"; $album_pic_result = @mysql_query($pic_sql); $row = mysql_fetch_array( $album_pic_result ); $album_pic_result = $row['album_picture']; if ( $album_pic_result != "" ) { $album_pic = 'addons/audio/images/album_images/' . $album_pic_result; } else { $album_pic = 'addons/audio/images/' . $default_album_pic; } $result_image_array = array('media_image' => $album_pic); break; case 'images'; $full_view = $result1['image_id']; $full_url = $config['site_base_url'] . '/addons/albums/images/'.$full_view; $result_image_array = array('media_image' => $full_url); break; case 'blogs'; $blog_owner = $result1['user_id']; $a1_sql = "SELECT file_name, approved FROM pictures WHERE user_id = $blog_owner"; $a1_result = @mysql_query($a1_sql); if (@mysql_num_rows($a1_result) != 0) { $a1_result = @mysql_fetch_array($a1_result); $a1_existing_file = $a1_result['file_name']; $a1_approved = $a1_result['approved']; if ($a1_approved == "yes") { $poster_picture = $config['site_base_url'] . '/pictures/' . $a1_existing_file; } else { $poster_picture = $config['site_base_url'] . "/themes/$user_theme/images/placeholder.gif"; } } else { $poster_picture = $config['site_base_url'] . "/themes/$user_theme/images/placeholder.gif"; } $result_image_array = array('media_image' => $poster_picture); break; } // end switch media images //merge arrays if ( sizeof($result_image_array) > 0 ) $result2 = @array_merge($result1, $comments_array, $stars_array, $result_image_array); else $result2 = @array_merge($result1, $comments_array, $stars_array); $result_search[] = $result2; } } $video_price = videoPrice(); $total_price = $video_price * $total_records; $member_credits = get_member_credits($user_id); //PAGINATION PLUS $url = 'search.php'; $additional_url_variable = "?keyword=$keyword&type=$type&page="; include_once('includes/pagination.inc.php'); //PAGINATION PLUS >> end // checking for any error codes $codes = $_GET['code']; $error_code = errorcodes($codes); if (!empty($error_code)) { $blk_notification = $error_code['error_display']; $message_type = $error_code['error_type']; $error_message =$error_code['error_message']; } // create dynamic template words $url_link = $get_type; if ( $url_link == 'images' ) $url_link = 'albums'; if ( $query_get_type == 'group_profile' ) { if ( $results_show == 0 ) $type_groups = '0'; else $type_groups = 4; } $get_type = ucwords($get_type); $get_type_word = substr($get_type, 0, -1); $page_title = $config['site_name'] . ' ' . $get_type_word . ' ' . $lang_search . ' ' . $lang_results . ' ' . $lang_for . ' ' . $keyword; $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = $new_temp; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); if ( $query_get_type == 'group_profile' ) $TBS->MergeBlock('blkfeatured', $mygroups); else $TBS->MergeBlock('blkfeatured', $result_search); $TBS->MergeBlock('blkfeatured2', $result_search); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); function dieNice() { header("Location: index.php"); die(); } ?>
  23. Thanks for your help. I have not removed anything from the form. But I have added. I submitted this in the correct database under Submit Query, and a message appears that states "You have to choose at least one coulmn to display". Can you help direct me from here, please? <?php $sql = "INSERT into member_profile (email_address, user_name, password, passwordSalt, first_name, last_name, Address_1, Address_2, City, State, zip_code, country, birthday, account_status, account_type, date_created, random_code) VALUES ('$email_address', '$user_name', '$password', '$passwordSalt', '$first_name', '$last_name', '$Address_1' '$Address_2' '$City', '$State', '$zip_code', '$country_list', '$birthday', 'new', 'standard', NOW(), '$random_code')"; ?>
  24. Thanks for looking here. I'd like to move the list of thumbnails that appears on the serch page of this php script (see attached). They appear on the left side of the right column. I'd like them to appear on the right side of the right columns and was told to tweak the serch results part of the page and the css. So i thought i'd start with the search resukts code> Can you help me determine which part of this code I could change to accomplish this? Thanks. Any help will be appreciated. <!--Begin Left Column--> <div id="column-left-2"> <br /> <!--Begin Popular Tag Cloud populate from search type ??--> <div class="header-narrow"><h3>[var.lang_Tags_most_popular]</h3></div> <div class="whats-showing"><!--[var.tag_cloud_block;htmlconv=no;comm]--></div> <div class="container-narrow-bottom"></div><!--End Popular Tag Cloud--> <!--Begin Left Advert--> <div class="container-narrow-top"></div> <div id="advert-left"><!--[var.ads_left;htmlconv=no;comm]--></div> <div class="container-narrow-bottom"></div><!--End Left Advert--> <div style="height:120px;"> </div> </div><!--End Left Column--> <!--Begin Right Column--> <div id="column-right-2"> <!--Begin Video Search List--> <div style="height: 2px;"> </div> <span style="margin-bottom: 12px;" class="font5_15"> "[var.keyword]" [var.get_type_word] [var.lang_search] [var.results_show] - [var.results_of] of [var.total_records] [var.lang_results] <br />You must <a href="login.php">log in</a> to view these video search results.<br /><br /> </span> <div id="content-list"> <ul class="content-list-thumb"> <li><a href="videos/[blkfeatured.indexer;block=div]/[blkfeatured.title_seo;block=div]"><img src="uploads/thumbs/[blkfeatured.video_id;block=div].jpg" alt="video pic" width="120" height="90" border="0" /></a></li> </ul> <ul class="content-list-info"> <li><h4> <!--[var.lang_title]:--><!--<a href="videos/[blkfeatured.indexer;block=div]/[blkfeatured.title_seo;block=div]"><!--[blkfeatured.title;htmlconv=no;block=div;ope=max:70;comm]--></a>--></h4></li> <li><b><!--[var.lang_description]:--> </b></li> <li><!--<span class="font4_12">[var.lang_rating] </span>--> <!--<img border="0" src="themes/[var.user_theme]/images/[blkfeatured.star1;block=div]" width="18" height="18" alt="1 Star" />--> <!--<img border="0" src="themes/[var.user_theme]/images/[blkfeatured.star2;block=div]" width="18" height="18" alt="1 Star" />--> <!--<img border="0" src="themes/[var.user_theme]/images/[blkfeatured.star3;block=div]" width="18" height="18" alt="1 Star" />--> <!--<img border="0" src="themes/[var.user_theme]/images/[blkfeatured.star4;block=div]" width="18" height="18" alt="1 Star" />--> <!--<img border="0" src="themes/[var.user_theme]/images/[blkfeatured.star5;block=div]" width="18" height="18" alt="1 Star" />--> <!--<span class="font4_12">[var.lang_views]: </span>--><!--(<!--[blkfeatured.number_of_views;block=div;comm]-->)--> <!--<span class="font4_12">[var.lang_duration]: </span>--><!--(<!--[blkfeatured.video_length;block=div;ope=max:45;comm]-->)--> <!--<span class="font4_12">[var.lang_uploaded]: </span>--> </li> <li><!--<span class="font4_12">[var.lang_tags]: </span>--></li> <!--<li><b>[var.lang_comments] - [var.lang_responses]: </b>(<!--[blkfeatured.comments;block=div;ope=max:80;comm]-->)</li>--> </ul> [onload;block=div;when [var.type_videos]=1;] </div> <!--End Video Search--> <!-- Pagination start --> <div align="center"> <div id="pagination"> <li> </li> <ul>[var.show_pages;htmlconv=no]</ul> </div> </div> <!-- Pagination end --> </div><!--End Right Column-->
  25. Thanks for your reply. I think this code below is it. Does it look like it? Thanks <?php error_reporting (0); include_once ('classes/config.php'); include_once ('includes/reserved_names.php'); // define access for loading non display php files define('access',true); $ahah = 1; $show_register = ''; $load_ajax = ''; $form_submitted = ''; $action = ''; $new_user_name = ''; $account_type = ''; $first_name = ''; $last_name = ''; $email_address = ''; $email_address2 = ''; $user_name = ''; $password = ''; $confirm_password = ''; $country_list = ''; $dob_month = ''; $dob_day = ''; $dob_year = ''; $zip_code = ''; $birthday = ''; $error_message = ''; $checked = ''; $show_register = 1; $load_ajax = 1; $procede = true; $action = mysql_real_escape_string( $_GET['action'] ); $new_user_name = mysql_real_escape_string( $_GET['new_user_name'] ); $site_name = mysql_real_escape_string($config['site_name']); $form_submitted = mysql_real_escape_string( $_POST['form_submitted'] ); if ( $action == 'check_user' ) { $new_user_name = trim(strtolower($new_user_name)); if ( $new_user_name == '' ) { echo "<font color=\"#EE0000\" size=\"2\"><b>".$config['fill_all_fields']."</b></font>"; die(); } if ( strlen($new_user_name) < 4 ) { echo "<font color=\"#EE0000\" size=\"2\"><b>".$config['username_4_chars']."</b></font>"; die(); } // check against reserved names e.g. -> admin etc... or adult words ban if ( in_array( $new_user_name, $reserved_names ) ) { echo "<font color=\"#EE0000\" size=\"2\"><b>".$config['username_not_allowed'] .""; die(); } $sql = "SELECT user_name FROM member_profile WHERE user_name = '$new_user_name'"; $query = @mysql_query($sql); $count = @mysql_num_rows($query); if ( $count > 0 ) { echo "<font size=\"2\"><b>$new_user_name</b></font><font color=\"#EE0000\" size=\"2\"> <b>=> $lang_not_available</b></font>"; } else { echo "<font size=\"2\"><b>$new_user_name</b></font><font color=\"#00DD00\" size=\"2\"> <b>=> $lang_available </b></font>"; } @mysql_free_result($result); @mysql_close(); die(); } if ( $action == 'show_country' ) { $country_fields_all = ''; $show_fields = ''; $country_list = file('includes/country.list'); foreach ( $country_list as $country_select ) { $country_fields_all = $country_fields_all . $country_select; } $show_fields = '<div style="margin-left:30px; float:left;"><b>'.$lang_country.':</b></div>'; $show_fields .= '<div style="margin-left:95px; float:left;" id="country_list">'; $show_fields .= '<select class="FormSpecialInput_1" id="country_list" name="country_list" style="font-size: 9pt; width:128px; height:20px; font-weight:bold; color:#444444; letter-spacing: 1; border: 1px solid #DFDCDC; background-color: #FDFDFD">'; $show_fields .= $country_fields_all; $show_fields .= '</select></div>'; echo $show_fields; die(); } if ( $procede == true ) { $account_type = 'Standard'; $first_name = trim(mysql_real_escape_string( $_POST['first_name'] )); $last_name = trim(mysql_real_escape_string( $_POST['last_name'] )); $email_address = trim(mysql_real_escape_string( $_POST['email_address'] )); $email_address2 = trim(mysql_real_escape_string( $_POST['email_address2'] )); $user_name = trim(mysql_real_escape_string( $_POST['user_name'] )); $password = trim(mysql_real_escape_string( $_POST['password'] )); $confirm_password = trim(mysql_real_escape_string( $_POST['confirm_password'] )); $country_list = trim(mysql_real_escape_string( $_POST['country_list'] )); $dob_month = (int) mysql_real_escape_string( $_POST['dob_month'] ); $dob_day = (int) mysql_real_escape_string( $_POST['dob_day'] ); $dob_year = (int) mysql_real_escape_string( $_POST['dob_year'] ); $zip_code = (int) mysql_real_escape_string( $_POST['zip_code'] ); if ( $_POST['terms'] == 'yes' ) { $checked = 'checked=\"checked\"'; $procede = true; } else { $procede = false; $error_message = $config['agree_to_terms']; } // dDB birthday must be this format =>2008-09-17 $birthday = $dob_year .'-'. $dob_month .'-'. $dob_day; foreach ($_POST as $key => $value) { if (!isset($value) || ($value == '')) { $display_key = @str_replace('_', ' ', $key); if ( $display_key == 'zip code' && $value == '' ) { $value = 'none'; } else { $error_message = $error_message . ' - ' . $display_key . ' '.$lang_required.' '; $procede = false; } } else { if ( $key == 'email_address2' ) $key = 'email_address'; if ( $key !== 'email_address' && (!eregi("^[ _a-zA-Z0-9-]*$", $value)) ) { $display_key = @str_replace('_', ' ', $key); $error_message = $error_message . ' - ' . $display_key . ' '.$config['invalid_email_text'].' '; $procede = false; } if ( $key == 'email_address' && !eregi("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-z]{2,3})$", $value) ) { $display_key = @str_replace('_', ' ', $key); $error_message = $error_message . ' - ' . $display_key . ' '.$config['invalid_email_format'].' '; $procede = false; } if ( $key == 'user_name' ) { // check against reserved names e.g. -> admin etc... or adult words ban if ( in_array( $user_name, $reserved_names ) ) { $display_key = @str_replace('_', ' ', $key); $error_message = $error_message . ' ' .$config['username_not_allowed'] . ' !'; $procede = false; } } } } } // checking if emails match if ( $procede == true ) { if ( $email_address !== $email_address2 ) { $error_message = ' '.$config['emails_do_not_match']; $procede = false; } } // checking if passwords match if ( $procede == true ) { if ($confirm_password !== $password) { $error_message = ' '.$config['password_do_not_match']; $procede = false; } } // checking if username and email is unique if ( $procede == true ) { $sql = "SELECT user_name, email_address FROM member_profile"; $query = @mysql_query($sql); while ($result = (@mysql_fetch_array($query))) { if ( !empty($result['user_name']) || !empty($result['email_address']) ) { // case insensitive login and registration $reg_user_name = strtolower($user_name); $db_user_name = strtolower($result['user_name']); if ($db_user_name == $reg_user_name) { $error_message = ' '.$config['username_is taken']; $procede = false; } if ( $result['email_address'] == $email_address ) { $error_message = $error_message . ' -'.$config['email_already_exists']; $procede = false; } } } } // if any errors display error message => [var.message_type] - [var.error_message] if ($procede == false && $form_submitted == "yes") { $message_type = $lang_error; $blk_notification = 1; $show_signup = 1; $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_signup_form.htm"; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); } // START => load page with form if ( !isset($form_submitted) || ($form_submitted == '') ) { $show_signup = 1; $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_signup_form.htm"; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->Render = TBS_OUTPUT; $TBS->Show(); die(); } // if no errors register user and load welcome page if ($procede == true) { $random_code = randomcode(); $password_email = $password; $password = md5($password); $passwordSalt = substr(md5(rand()), 0, 4); if ( $zip_code > '' ) { $country_list = 'USA'; } // insert new user record $sql = "INSERT into member_profile (email_address, user_name, password, passwordSalt, first_name, last_name, zip_code, country, birthday, account_status, account_type, date_created, random_code) VALUES ('$email_address', '$user_name', '$password', '$passwordSalt', '$first_name', '$last_name', '$zip_code', '$country_list', '$birthday', 'new', 'standard', NOW(), '$random_code')"; @mysql_query($sql) or die($config['error_26']);//error // get new user_id $sql = "SELECT user_id, email_address, random_code FROM member_profile WHERE random_code = '$random_code' AND email_address = '$email_address'"; $query = @mysql_query($sql); while ($result = @mysql_fetch_array($query)) { $user_id = $result['user_id']; } // set new user default privacy settings $sql = "INSERT INTO privacy (videocomments, profilecomments, privatemessage, friendsinvite, newsletter, user_id, publicfavorites, publicplaylists) VALUES ('yes', 'yes', 'yes', 'yes', 'yes', '$user_id', 'yes', 'yes')"; $query = @mysql_query($sql); @mysql_close(); // send email $email_template = 'email_templates/newmember.htm'; $subject = $config['email_welcome']; $to = $email_address; $from = $config['notifications_from_email']; //send email template to TBS for rendering of variable inside $template = $email_template; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->tbs_show(TBS_NOTHING); $message = $TBS->Source; //load postage.php define('access',true); include ('includes/postage.php'); // show success $notification_type = $config['notification_success']; $message = $config['registration_success']; $blk_notification = 0; $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(); } ?>
×
×
  • 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.