Welcome to Geeklog, Anonymous Wednesday, August 17 2022 @ 10:27 am EDT

Geeklog Forums

Some pointers/help needed


Status: offline

spatz4000

Forum User
Junior
Registered: 07/14/06
Posts: 25
I have this snippet of code, which is a part of the larger pieice of code "theme tester"

Text Formatted Code

/*----------------------------------------------ORIGINAL CODE---------------------------------------------------------------------------------------*/
   /*  if ($_USER['uid'] > 1 AND $thememode == 'save' AND !empty($usetheme)) {
        DB_query("UPDATE {$_TABLES['users']} SET theme='$usetheme' WHERE uid = {$_USER['uid']}");
        echo COM_refresh($PHP_SELF);
    }  */
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/


/*----------------------------------------------NEW CODE----------------------------------------------------------------------------------------------*/

if ($_USER['uid'] > 1 AND $thememode == 'save' AND !empty($usetheme)) {
        DB_query("UPDATE {$_TABLES['users']} SET theme='$usetheme' WHERE uid = 1" ); /*{$_USER['uid']}"); */

        echo COM_refresh($PHP_SELF);
    }  
/*--------------------------------------------------------------------------------------------------------------------------------------------------------*/


}
 


Ignoring the security aspects right now ( I'm not checking for admin user, right now ) why is change not getting written to the database? I have 4 themes. I can change themes no problem, but nothing gets put into the database.

Any ideas?
 Quote

Status: offline

artur

Forum User
Junior
Registered: 08/18/06
Posts: 16
uid = 1 == anonymous user
and has anonymous user row in this table?
 Quote

Status: offline

spatz4000

Forum User
Junior
Registered: 07/14/06
Posts: 25
Quote by artur: uid = 1 == anonymous user
and has anonymous user row in this table?


I don't follow.
 Quote

All times are EDT. The time is now 10:27 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content