Search found 17 matches

by worker201
Fri Jun 27, 2008 1:48 am
Forum: [2.0.x] MOD Writers Discussion
Topic: general redirect() question
Replies: 5
Views: 8886

Re: general redirect() question

What's the purpose to redirect the not-logged-in users to the index page instead to clearly let them know they have to register in order to do 'blah' ? Perhaps sending them to the login screen would make more sense. But your code does not tell them why they have been sent to the login screen. Sendi...
by worker201
Thu Jun 26, 2008 4:43 am
Forum: [2.0.x] MOD Writers Discussion
Topic: debug SQL query
Replies: 22
Views: 14808

Re: debug SQL query

Consider this issue solved, thanks everyone for your input and guidance.
by worker201
Thu Jun 26, 2008 4:40 am
Forum: [2.0.x] MOD Writers Discussion
Topic: general redirect() question
Replies: 5
Views: 8886

Re: general redirect() question

Works like a charm, much appreciated. Your curly brace typo threw me for a minute, but I figured it out. New code: if ( !$userdata['session_logged_in'] ) { $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx?") . '">')); message_die(GENERAL...
by worker201
Thu Jun 26, 2008 4:23 am
Forum: [2.0.x] MOD Writers Discussion
Topic: debug SQL query
Replies: 22
Views: 14808

Re: debug SQL query

That value would be found in $user->data['user_itc_status'] Oops, that's phpBB3 syntax. phpBB2 syntax is simply $userdata['user_itc_status']. :-P I thought $userdata referred to the currently logged in user. This code is called by a registered user but affects another registered user. My understand...
by worker201
Thu Jun 26, 2008 2:51 am
Forum: [2.0.x] MOD Writers Discussion
Topic: general redirect() question
Replies: 5
Views: 8886

general redirect() question

(I know there's a similar active topic about this right now, but I didn't want to hijack the other user's thread) I have the following bit of code: if ( !$userdata['session_logged_in'] ) { message_die(GENERAL_MESSAGE, $lang['Not_authorized']); redirect(append_sid("index.$phpEx")); } Basically, if a ...
by worker201
Tue Jun 24, 2008 6:09 am
Forum: [2.0.x] MOD Writers Discussion
Topic: debug SQL query
Replies: 22
Views: 14808

Re: debug SQL query

My ineptness comes from poorly mimicking code found in other parts of phpBB. In the UPDATE queries I studied, values were never directly passed -- variables were set and then their values were passed. The line from this part of the code that reads: $user_itc_status = 1; was part of my attempt to fol...
by worker201
Tue Jun 24, 2008 2:32 am
Forum: [2.0.x] MOD Writers Discussion
Topic: debug SQL query
Replies: 22
Views: 14808

Re: debug SQL query

There's another place on the page that changes a piece of text based on the value of user_itc_status. When that didn't change, I checked the tables, to see if it was the query failing or the text change. The tables indicated that the query was not executing properly, which is why I came here for som...
by worker201
Mon Jun 23, 2008 11:33 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: debug SQL query
Replies: 22
Views: 14808

Re: debug SQL query

After running the following code: if (isset($HTTP_GET_VARS['status'])) { echo ("Got a status from GET<br />"); $user_itc_status = 1; $invitee = intval($HTTP_GET_VARS['user']); if (is_int($invitee)) { $sql = "UPDATE " . USERS_TABLE . " SET user_itc_status = 1 WHERE user_id = $invitee"; echo ("going t...
by worker201
Mon Jun 23, 2008 3:25 am
Forum: [2.0.x] MOD Writers Discussion
Topic: debug SQL query
Replies: 22
Views: 14808

Re: debug SQL query

I have made a few changes, which will help to sanitize things, but it still doesn't work. if (isset($HTTP_GET_VARS['status'])) { $user_itc_status = '1'; $invitee = htmlspecialchars($HTTP_GET_VARS['user']); if (is_int($invitee)) { $sql = "UPDATE " . USERS_TABLE . " SET user_itc_status = '1' WHERE use...
by worker201
Sun Jun 22, 2008 9:46 am
Forum: [2.0.x] MOD Writers Discussion
Topic: debug SQL query
Replies: 22
Views: 14808

Re: debug SQL query

Paul wrote:There need to be single quotes around the $$invitee variable.
Like this?

Code: Select all

WHERE username = '$invitee'";
Paul wrote:Also, you need to santinize that var to prevent SQl i njection.
Please explain what you mean by that. Sanitize?
by worker201
Sun Jun 22, 2008 9:12 am
Forum: [2.0.x] MOD Writers Discussion
Topic: debug SQL query
Replies: 22
Views: 14808

debug SQL query

I have an SQL query that I'm working on. Finally got it to the point where there aren't any syntax errors. Now it does absolutely nothing. I can't tell if it's my SQL query that's screwy, or my implementation. The block of code in question: if ( isset($HTTP_GET_VARS['status'])) { $user_itc_status = ...
by worker201
Sun Jun 22, 2008 9:05 am
Forum: [2.0.x] MOD Writers Discussion
Topic: triggering events with submit buttons
Replies: 2
Views: 8413

Re: triggering events with submit buttons

I guess what I really wanted was information about how to write HTTP_GET_VARS and HTTP_POST_VARS statements, and throw together urls that would work with them. But I think I maybe have it.

You can mark this as solved.
by worker201
Sat Jun 21, 2008 9:54 am
Forum: [2.0.x] MOD Writers Discussion
Topic: triggering events with submit buttons
Replies: 2
Views: 8413

triggering events with submit buttons

(I'm pretty new to this, so excuse ignorance of the codebase or terminology) What I would like to do is have a button (or maybe just a link if necessary) on a page. When the button gets clicked, some stuff happens - a system variable is set, a value gets inserted to an sql table, or the content of t...
by worker201
Sat Apr 12, 2008 10:59 am
Forum: [2.0.x] MOD Writers Discussion
Topic: parsing URLs in post body
Replies: 7
Views: 1207

Re: parsing URLs in post body

Another potential problem with the word censor is that many of the abbreviations are overlapping. For example, one is SW, and another is YSW. Since SW matches both, what happens? I'm working on producing a regexp that will cover these cases.
by worker201
Fri Apr 11, 2008 11:55 pm
Forum: [2.0.x] MOD Writers Discussion
Topic: parsing URLs in post body
Replies: 7
Views: 1207

Re: parsing URLs in post body

I considered the word censor, but it wasn't appropriate for my idea. What I want to do is make a tooltip glossary for certain weird abbreviations my users use constantly. The idea would be to find these abbreviations and throw span tags around them with titles. That way, a person who has forgotten t...

Go to advanced search