Jump to content

envexlabs

Members
  • Posts

    256
  • Joined

  • Last visited

    Never

Everything posted by envexlabs

  1. Hey, What you would do is, create a form. When the form is submitted, create a table in the database with all the info. Have a cell called approve, and give it a value of 0. Use phpmailer to send out an email with a link. This link would point to a file that updates the database table, setting approve to 1.
  2. Hey, I've created a newsletter system where a user can send newsletters to member who have subscribed. To fight spam, the sender doesn't see the address that are subscribed. As another feature i want to make it so that the sender can only send 1 newsletter a day. I was thinking about just setting a cookie, but most people aren't stupid and could just delete the cookie. Is there a way to lock a cookie, or a better for of locking a user out for a set time? Thanks, envex
  3. not 100%, but i'm sure you can. You could also declare it a global $variable.
  4. That is right. You create your query which grabs the first 3 rows, these are the newest in the database. $select = mysql_query('SELECT * FROM messages LIMIT 3'); Assuming that the ID field is the first field, you render out a link with each row. while($message = mysql_fetch_row($select)){ echo 'Name' . '<a href="index.php?delete=true&id=' . $message[0] . '">Delete?</a>' } That will render out a link, with a dynamic delete link, for each row.
  5. Still no dice. I'm going to skip this for now, have other parts to develop Thanks again.
  6. Hey, You could add a $_GET variable in the next and previous links ie: echo '<a href="page.php?limit=' . ($limit + 5) . '">Next</a>';
  7. Lets see if i can explain this fully (sidenote: not being an asshole) store_tags hold the tag_id each store has selected. store_id | tag_id ------------------- 2 | 3 2 | 12 3 | 15 4 | 28 tags holds the tag_id, name for each tag, and the cat_id it belongs to. tag_id | name | cat_id ------------------------- 3 | men | 2 12 | women | 3 16 | children | 4 tag_category holds the cat_id and name for each category. cat_id | cat_name -------------------- 2 | shirts 3 | pants 4 | hats I need to render out a list like so: Category Name Tag Tag Tag The thing is, i only want to display categories that have tags that stores are using. I setup the database not knowing that the client wanted it this way, so i've done this completely the wrong way. Thanks for all your help, it's greatly appreciated!
  8. Hey, I've tried your code, but i got an error, so i print_r'd $tag_category and all i'm getting is the 'cat_name'.
  9. Hey, I have a script that crops and image and resizes it, but that's not the problem. If the image is smaller than the crop area, PHP just fills it in with black. Is there a way to make PHP fill it in with white instead of black? Thanks, envex.
  10. Store tags holds the information for each store. ie. store_id and tag_id The tags table holds the tag_id, tag_name, and cat_id.
  11. Hey, That didn't seem to do the trick. If you look right now: http://www.werehavingasale.com/moretags.php it's display every category, i only want to show the categories that have tags.
  12. Well, The title tag is what shows you specific text on roll over, the alt tags display's text when the image cannot be found. Try looking for Javascript ToolTips.
  13. The post above has it right. you weren't putting the mysql_query into a variable. to make things easier try going like this: $myquery = mysql_query('SELECT * FROM `table`'); $matt = mysql_num_rows($myquery); Just alot simpler
  14. Hey, I will try to explain this as best as i can. Right now i have this code: $select_tags_query = mysql_query('SELECT * FROM `tag_category`'); while($tag_category = mysql_fetch_row($select_tags_query)) { $tags_query = mysql_query('SELECT * FROM `tags` WHERE `cat_id` = ' . $tag_category[0] . ''); echo '<div class="tag_cat">'; //renders out the category name echo '<h3>' . $tag_category[1] . '</h3>'; //renders out each tag in the category while($tags = mysql_fetch_row($tags_query)) { $tag_used = mysql_query('SELECT * FROM `store_tags` WHERE `tag_id` = ' . $tags[0] . ''); if(mysql_num_rows($tag_used) == 0){ //do nothing }else{ echo '<p class="tag_check"><a href="search.php?tag=' . $tags[0] . '">' . $tags[2] . '</a></p>'; } } echo '</div> <!-- tag_cat div -->'; } Which renders out all the catagories, and then only tags that have been selected by users of the site. ie: Cat One Cat Two Cat 3 Tag Tag Tag Tag Cat 4 Tag Cat 5 Cat 6 The way the database is setup is: store_tags --------------- store_id | tag_id tags --------------- tag_id | cat_id | tag_name tag_cat --------------- cat_id | cat_name The problem i am having is, how to only render out categories that have tags that are used.
  15. Well, it seems i spoke way to soon i'm still randomly getting logged out, every page has session_start(). When i get logged out, if i hit refresh, i'm magically logged back in. Any help is greatly appreciated! Thanks, envex
  16. Hey, I figured it out, i had recently created 2 php files which dealt with uploading and cropping images, i forgot to add session_start() to them. i know, i'm an idiot
  17. Hey, That seems to work, but it's only displaying 3 out of 6 products. ie. I have products 4, 8, 15, 18, 19, & 20. When i am viewing products 4, the products at the bottom are 8 & 15. If i cycle through all of them, i only ever see 4, 8 & 15.
  18. k, quick offset question. In media temple's php.ini file, if it's not listed, does it revert to the default value? Or should i still add it for good measure?
  19. Hey, It doesn't happen on specific pages, and it usually happens shortly after i've logged in. The login.php code is: include('./config.inc.php'); $t = & new_smarty(); $_product_id = array('ONLY_LOGIN'); if (isset($_REQUEST['amember_redirect_url'])) $_SESSION['amember_redirect_url'] = $_REQUEST['amember_redirect_url']; function rcmp_begin_date($a, $b){ return strcmp($b['begin_date'], $a['begin_date']); } include($config['plugins_dir']['protect'] . '/php_include/check.inc.php'); $payments = & $db->get_user_payments(intval($_SESSION['_amember_id']), 1); usort($payments, 'rcmp_begin_date'); $now = date('Y-m-d'); $urls = array(); foreach ($payments as $k=>$v){ if (($v['expire_date'] >= $now) && ($v['begin_date'] <= $now)) { $p = get_product($v['product_id']); $url = $p->config['url']; if (strlen($url)){ $urls[] = $url; } } } if ($_SESSION['amember_redirect_url']) { $redirect = $_SESSION['amember_redirect_url']; unset($_SESSION['amember_redirect_url']); } elseif (count(array_unique($urls)) == 1){ if (in_array('htpasswd_secure', $plugins['protect'])){ $member_login_pw = htpasswd_secure_get_login($_SESSION['_amember_user']['login']). ':'. htpasswd_secure_get_passwd($_SESSION['_amember_user']['pass']); $redirect = add_password_to_url($urls[0], $member_login_pw); } else { if ($config['display_member_pw_urls']) { $member_login_pw = $_SESSION['_amember_user']['login']. ':'. $_SESSION['_amember_user']['pass']; $redirect = add_password_to_url($urls[0], $member_login_pw); } else { $redirect = add_password_to_url($urls[0]); } } } else { $redirect = "/index.php"; } #print_r($urls); html_redirect("$redirect", 0, 'Redirect', _LOGIN_REDIRECT);
  20. Hey, I've got an amember problem, and i thought maybe someone here could help me seeing as the support over at amember is excruciating. For some reason i'm getting logged out randomly when surfing my site. I only use amember to deal with payments, signups and logins. I've used session_start() at the top of each page, and each page has the correct session variables. Anyone have any idea? Thanks, envex
  21. Hey, no, instead of grabbing the latest products, i want it to show the next 2 products from product #1.
  22. Hey, I have a product page which grabs a product, lets say the ID = 1. At the bottom of the page it grabs the 2 latest products created by that user. I would like it to grab the next 2 products in the database instead of the latest. So, Product 1 Other Products Product 5 and Product 6 Anyone have any ideas? envex
×
×
  • 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.