Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

.ęνø.

Members
  • Joined

  • Last visited

Everything posted by .ęνø.

  1. I know the function, but I'll be damned if I know how to use it properly, lol. I'm making a script to check if a user is logged in, and there is one bump in the road I can't resolve: how to check if an IPB session is valid. Here's what I have so far: // User ID $user_id = isset($_COOKIE['member_id']) ? $_COOKIE['member_id'] : ""; // Check if logged in $cook_session = $_COOKIE['session_id']; $cook_hash = $_COOKIE['pass_hash']; if (!empty($cook_session) && !empty($cook_hash)){ if ($cook_session != "0" && $cook_hash != "0"){ $ipb_session = mysql_result(mysql_query(sprintf("SELECT id FROM ". $ipb_prefix ."_sessions WHERE member_id='%s'", mysql_real_escape_string($user_id))),0); $ipb_hash = mysql_result(mysql_query(sprintf("SELECT member_login_key FROM ". $ipb_prefix ."_members WHERE id='%s'", mysql_real_escape_string($user_id))),0); if ($cook_session = $ipb_session && $cook_hash = $ipb_hash){ if (session_is_registered(/* what to put here? */)){ $logged_in = true; } else { $logged_in = false; } } else { $logged_in = false; } } else { $logged_in = false; } } else { $logged_in = false; } The rest of the script works fine, there are some kinks, but the main functionality is good. It's just that, when you log into an IPB forum, a session is created. Now if you are inactive on the forum for a certain amount of time, the session is destroyed and you are logged out. The problem with my script is that it doesn't know when the session is destroyed therefore it still thinks you're logged in when you aren't.
  2. .ęνø. replied to Guezala's topic in Server Side
    I use Notepad++. It's got everything I need/want plus more!
  3. Also make sure you have permission to use .htaccess, it's always a bitch when you don't.
  4. Those variables are set when the function is called. eg: function test($test){ echo "testing function". $test ."testing function"; } test("abcd"); would be the same as this: echo "testing function abcd testing function"; Oh I see... I haven't learnt how to do arrays properly yet, lol. It's something I'm going to have to get around to. Anyway, now my script is working well, if anyone wants to know how to detect if you are logged on to an IPB forum externally, let me know, lol.
  5. Well the main point of creating the function was so I didn't have to keep creating extra variables for every query I made, so I think it'll be easier just to use variables like this: $ipb_session = mysql_result(mysql_query(sprintf("SELECT id FROM ". $ipb_prefix ."_sessions WHERE member_id='%s'", mysql_real_escape_string($user_id))),0); Thanks for your help though.
  6. Doesn't show anything. I've just discovered that mysql_result only fails in a function for some reason. If I use that coding outside a function it works, but if it's in a function I get this error: Warning: mysql_result(): supplied argument is not a valid MySQL result resource in * on line *
  7. Ok, so I'm coding this script, and I need to see if a member is logged in to an IPB forum. I know how to do that and all, but one function I need in order to majorly simplify and shorten the script, is refusing to work. Basically it's a database query, anyway have a look at what I've got and you should be able to figure out what I want to do, and hopefully where I went wrong. function query_ibf($table,$field){ $query = sprintf("SELECT ". $field ." FROM ". $table); $result = mysql_query($query); echo $result; // I'm almost certain this is the problem } I call the function, but nothing happens. Also, don't psyc out at me for trying to echo the result, lol. It was a last resort as I've also tried mysql_fetch_array, mysql_fetch_assoc and mysql_result but they all returned errors. If you're a little confused still, here's how I used it. $ipb_session = query_ibf("sessions","id"); Thanks to anyone who can help!
  8. That design looks much better. But I'm not really digging the color scheme. Maybe try some shades of brown similar to the other one?
  9. Here are some pointers: - make the whole thing a bit wider - make everything just a little bit closer together - make the banner a little smaller heightwise, and make it less blurry - make the Folded cards >> General part the same width as the part above it - use the same font all the way through the website - make the copyright text a little smaller - put a little but of margin at the top, like it is at the bottom - make the whole thing have rounded corners - instead of using hover images in the nav table, just make the background image change for each row on hover and use plain text
  10. IPB all the way, it's brilliant. You only have to pay once for a license, and you can use it forever. There are tonnes of forums around for free mods and free skins, it's really customizable, powerful, everything.
  11. I can't seem to get it to work properly. :\ I can block an image, but when I try to get it to be replaced by another image it still only blocks it.
  12. Thanks, I'll have a try of that tomorrow.
  13. I want it so if my images try to get accessed by a different domain, it shows a specified image rather than the one they are hot linking.
  14. .ęνø. replied to Aled Mann's topic in Frontend
    What I usually do when I code PHP or do CSS, is think up of a prefix for your own stuff. eg. you could put mine_ before all your CSS objects.
  15. evo-fx Add me if you want, just comment saying your from WDF.
  16. .ęνø. replied to .ęνø.'s topic in Server Side
    Ok people not to worry, I finally got it to configurez. // in config.php $db_host = "***"; # host $db_name = "***"; # database name $db_user = "***"; # username $db_pass = "***"; # password // in functions.php $db_connect = mysql_connect($db_host,$db_user,$db_pass); mysql_select_db($db_name,$db_connect); $dyn_pvar = isset ($_GET['p']) ? $_GET['p'] : "home"; function dyn_content($dyn_pvar){ $dyn_query = sprintf("SELECT * FROM a_main WHERE short='%s'", mysql_real_escape_string($dyn_pvar)); $dyn_result = mysql_query($dyn_query); $dyn_found = (boolean) ($dyn_result) ? mysql_num_rows($dyn_result) : FALSE; if ($dyn_found == 0) { $dyn_query = sprintf("SELECT * FROM a_main WHERE short='%s'", mysql_real_escape_string("404")); $dyn_result = mysql_query($dyn_query); } while ($row = mysql_fetch_assoc($dyn_result)) { echo $row['content']; } mysql_free_result($dyn_result); } // in index.php require_once("config.php"); require_once("functions.php"); show_content($dyn_page); I have no idea why it wouldn't work before, but all we need to know is that it works now.
  17. .ęνø. replied to .ęνø.'s topic in Server Side
    *bump*
  18. .ęνø. replied to .ęνø.'s topic in Server Side
    Ok now I'm having trouble testing if the record exists, and it's really giving me the ****s. If any more help is available it would be much appreciated.
  19. .ęνø. replied to .ęνø.'s topic in Server Side
    Thanks for that, and the function is definitely being called, otherwise I wouldn't have been able to debug the database connection and query. EDIT: I found a solution! It was the variable in the query that it didn't like, it wasn't parsing the variable it was actually looking for $dyn_page in the table. // in config.php $db_host = "***"; # host $db_name = "***"; # database name $db_user = "***"; # username $db_pass = "***"; # password // in functions.php $db_connect = mysql_connect($db_host,$db_user,$db_pass); mysql_select_db($db_name,$db_connect); $dyn_page = isset($_GET['page']) ? $_GET['page'] : "home"; function show_content($dyn_page){ $query = sprintf("SELECT content FROM a_main WHERE short='%s'", mysql_real_escape_string($dyn_page)); $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { echo $row['content']; } mysql_free_result($result); } // in index.php require_once("config.php"); require_once("functions.php"); show_content($dyn_page); Now I just got to get a 404 function happening.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.