1. Ressource id #8

    Date: 08/16/05 (PHP Community)    Keywords: php, mysql, database, sql, google

    $query = "SELECT * FROM users WHERE username = '$username' LIMIT 1;";
    $result = mysql_query($query);
    if ($result) { 
     # deny this user // already in
    }
    else { 
     # add new user
    }
    

    $result ouputs "Ressource id #8." I tried different set of variables in case it could be the problem but everything echo with the correct values. What I'm looking for is: check into the database, if there a equal username already registered. Both tries [with an existant and an unexistant username], it returns the same error. I've looked around either google.com and php.net, it turned on hopeless.

    Can you help me out?

    Source: http://www.livejournal.com/community/php/336854.html

  2. MS Access and Visual Basic

    Date: 08/17/05 (Code WTF)    Keywords: templates, mysql, sql, microsoft

    Hi. I'm trying to "beef up" one of the Access general templates for use, and I'm running into a problem.

    I'm using the "Contacts Management" template, and have added a field "ReferredBy" to the Contacts table. I was wanting to add this as a search item on the "Report Date Range" form, so that I can have a report organized not only by date but grouped by ReferredBy.

    I hope this makes sense, I am experienced with Access but not very experienced with Visual Basic. I've done a ton with MySQL, and thought this would be related. I guess I'm wrong... ;-)

    I've been able to add the ReferredBy to the Report Date Range form. However, I get an error:

    Run-time error '2465': Microsoft Access cannot find the field "|" referred to in your expression.

    The VBA for the Report Date Range looks like this:

    Private Sub Form_Open(Cancel As Integer)
    Me.Caption = Me.OpenArgs
    Me![Referred By] = [ReferredBy]
    Me![Beginning Call Date] = Date - Weekday(Date, 2) + 1
    Me![Ending Call Date] = Me![Beginning Call Date] + 6
    End Sub

    Everything works fine when I don't have the "Referredby" line in there, but it does nothing with that item... The way the code is now, it seems circular, but my brain can't figure out how to fix it.

    Please help. I am so frustrated and just looking for a little help, even just where I need to go to get help.

    Thank you!

    x-post in '[info]'sharonme

    Source: http://www.livejournal.com/community/code_wtf/13145.html

  3. Rarg!

    Date: 08/17/05 (SQL Server)    Keywords: database, asp, sql, microsoft

    Okay, so I really have no idea what I'm doing with this, so I'm sorry if this seems kinda dumb.

    I'm trying to install the "Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) Release A" on the computer here, and it seems to install fine.

    I go to the command line and run the setup file with my chosen password. No problem (I hope).

    My end goal is to try and get one of the ASP.NET starter kits to install and think there's a database system on this computer (So I don't have to use MS Access. Ew.), but whenever I go to install the program, I choose the database on the LocalHost, and it gets no connection.

    So, I'm wondering, is there something else I have to do to start up the Desktop Engine and get it running?

    I'm kind of flying blind here, and the read-me doesn't make a whole heck of a lot of sense.

    So, thanks for any help you can give me!

    Source: http://www.livejournal.com/community/sqlserver/31202.html

  4. VFP tables with memo fields -> SQL Server.

    Date: 08/16/05 (SQL Server)    Keywords: sql

    Related to my last post with only the most tenuous of links. (I've been trying to see what's been going on with these stupid tables, which takes a lot longer than three minutes, but am too damned lazy to run the queries in Query Analyzer.)

    Is there a simple way of importing VFP (6.0) tables containing memo fields into SQL Server (2000)? No matter how I try to do it, the import completely ingores the memo fields. E.g.:

    VFP
    column 1 - character(5)
    column 2 - memo
    column 3 - memo
    column 4 - int

    SQL
    column 1 - character (5)
    column 2 - int
    column 3 - filled with NULLs
    column 4 - filled with NULLs

    I've tried going straight through ODBC and copying out to text then importing from SQL from the text file; same result.

    This is something that's plagued me on and off throughout the years, but now I'm actually trying to do it for a project at work instead of for my own gratification, so I've got people who need this stuff...

    thanks.

    Source: http://www.livejournal.com/community/sqlserver/30747.html

  5. Database design

    Date: 08/18/05 (SQL Server)    Keywords: programming, database, sql

    As part of my job I use T-SQL, mostly for writing stored procedures. So I'm familiar w/ select/insert/update/delete/cursor/view etc.. But I never created a complicated database or a table schema from scratch. We have a DBA who usually does that.

    Now, our DBA is swamped, so my boss wants me to take a part of our project and design a database for it (to be reviewd by our DBA). While it's flattering that she thinks so highly of my abilities, I feel that I need some serious education before I take this on.

    Please, advise me on a good book on database design!!! Preferably a clearly-written easy-to-read one (think Kernighan & Ritchie's "The C Programming Language ", not Stroustrup's "The C++ Programming Language"). If you don't know an easy-to-read one, a hard-to-read-but-very-informative will do!

    TIA

    Source: http://www.livejournal.com/community/sqlserver/31387.html

  6. Прикольные исходники

    Date: 08/22/05 (Code WTF)    Keywords: sql, java, linux

    Java poetry, Linux Haiku, SQL poem, Allitle rude VB poem.

    Читать тут http://www.cs.huji.ac.il/~sashakra/ на английском.

    Source: http://www.livejournal.com/community/code_wtf/13570.html

  7. Need help with SELECT syntax.

    Date: 08/23/05 (MySQL Communtiy)    Keywords: mysql, database, sql

    Okay, I have a dilemma.

    I'm not sure how to assemble a SELECT query for what I want to do.

    I have a database of ratings for books and movies. Each rating/review is placed into a new row, with a reference number for the item they're related to (actual books and movies are in their own table). and I wish to run a SELECT that will find rating entries for books that have a minimum of 5 entries (ie; 5 rows).

    I'm somewhat of a newcomer to mysql, but I'm not a complete moron. I've been able to set up long and complex query strings, but for some reason, this is befuddling me.

    Any ideas?

    ** EDIT **

    Problem solved, thanks to '[info]'timeimp & '[info]'bobalien

    The resulting query ended up being:

    $query = "SELECT book_reviews.bookid AS idofbook, avg(book_reviews.rating) "
    $query .= "AS nrating, books.bookname AS nameofbook FROM book_reviews,books "
    $query .= "WHERE books.id = book_reviews.bookid GROUP BY book_reviews.bookid "
    $query .= "HAVING count(book_reviews.rating) >= 5 ORDER BY nrating DESC LIMIT 10";

    Source: http://www.livejournal.com/community/mysql/67126.html

  8. php question

    Date: 08/24/05 (WebDesign)    Keywords: php, asp, sql

    *For those who know php* I love coding (learned Basic and logo back in middle and highschool and took C++ in college) and would like to get a grasp of php and sql. I know the more you practice it the more you learn but I wanted to know in general how long it took everyone to learn php at the intermediate level.

    Source: http://www.livejournal.com/community/webdesign/963120.html

  9. How to Determine if your Sensitive Data is Safe in Shared Hosting

    Date: 08/26/05 (Java Web)    Keywords: mysql, sql, security, web, hosting

    One of the strong security concerns in shared hosting environments is whether your sensitive data like MySQL server login/password or other login/password is actually safe from other users sharing the same web hosting machine. Few shared hosting providers do not provide telnet/ssh. They are normally more secure. However I would not recommend them for two [...]

    Source: http://blog.taragana.com/index.php/archive/how-to-determine-if-your-sensitive-data-is-safe-in-shared-hosting/

  10. identity column

    Date: 08/26/05 (SQL Server)    Keywords: sql

    I'd like to create an column in one of my tables that contains unique five digit numbers to use as an identifier. I'm a bit of a SQL Server newbie, so forgive me if this is simple. I found the identity() property, which is works well enough to give me ascending numbers, but I want my numbers to always have five digits.

    So I'd want the first record to be 00001, the second to be 00002, the third to be 00003, etc. Right now, I'm getting the first record as 1, the second as 2, the third as 3, etc.

    Thoughts?

    Source: http://www.livejournal.com/community/sqlserver/32440.html

  11. Restore Database via Script?

    Date: 08/31/05 (SQL Server)    Keywords: database, sql, microsoft

    I use Microsoft SQL Server 2000, for use with Microsoft Great Plains. Right now, I am working on building a backup server, incase the main server goes down (which has happened 2 times in the past 6 months).

    My question is, is there a way to restore a database using a script that could be run from a Windows Command Box (cmd.exe)?

    If you need more information, just let me know.

    Thank you very much,

    Peace,
    Kevin

    Source: http://www.livejournal.com/community/sqlserver/32532.html

  12. Dynamic SQL Again

    Date: 09/05/05 (Web Development)    Keywords: sql

    I need to be able to run a if statement in my sql
    stored procedure so that is a checkbox value is
    equal to zero then that query clause gets ignored.

    I know it can be done i just don't remember how

    Source: http://www.livejournal.com/community/webdev/241267.html

  13. php, mysql search engine

    Date: 09/07/05 (MySQL Communtiy)    Keywords: cms, php, mysql, html, sql

    Ok, I’m trying to make a nice little search script for my CMS. The whole site is in the db, and I would like to have a way for people to be able to search all the content. Each entry in the db has an id, name, title, description and body. They may all contain html. now I would like to run a query that looks through all the fields (except the id) and pulls out all those that match, then display them in a table (I assume a while loop is fie for this). So what I'm really looking for is an sql query that will search all the fields. Now I would also like it to recognise boolean searches if this is possible.

    Ok, I’m sure you get the idea by now. Does anyone know how this might be achieved? Please note, my php knowledge is about a year old and my mysql is very poor. I have also been through mysql docs (mainly this page, but have found it s little beyond me).

    Thanks for any help

    x-posted to '[info]'php

    Source: http://www.livejournal.com/community/mysql/68021.html

  14. zip codes

    Date: 09/07/05 (MySQL Communtiy)    Keywords: php, mysql, html, database, sql

    i'm doing a project where i need to measure distances between zip codes; en route to a solution i stumbled upon a couple of handy resources that i figured i'd pass along:

    http://www.zend.com/codex.php?id=1486&single=1
    a class used to do various zipcode calculations such as distance and finding the zip codes within range of another zip code
    take a look at the class to see how he wants your tables and fields named for the state and zip code database tables

    http://www.cfdynamics.com/cfdynamics/zipbase/index.cfm
    zipbase - datbase of zip codes with lat & long info, state info, etc. available in a text file and an access datbase
    i used the textfile and in mysql said:
    mysql> LOAD DATA LOCAL INFILE 'c:/ZIP_CODES.txt'
    -> INTO TABLE zip_code
    -> FIELDS TERMINATED BY ',' ENCLOSED BY '"'
    -> LINES TERMINATED BY '\r\n';

    http://27.org/isocountrylist/usps_states_list.sql
    SQL file for creating a states table (i believe in the zipcode class, he wants the states table called "state")

    i used that to make a silly little app to test some of the features of the class:

     $zip){
    		$field = 'zip'.($key+1);
    		if(isset($_REQUEST[$field])){
    			if(is_numeric($_REQUEST[$field])){
    				$zips[$key] = $_REQUEST[$field];	
    			}
    		}
    	}
    	
    	
    
    ?>
    
    " method="GET"> " /> " />
    $zip){ if($zip){ echo "
      "; echo "$zip:"; $details = $zc->get_zip_details($zip); if(!empty($details)){ foreach($details as $key => $value){ echo "
    • $key: $value
    • "; } } echo "
    "; } } ?>
    get_distance($zips[0], $zips[1]); } ?>


    oh, and i found this http://centricle.com/tools/html-entities/ to convert app code into HTML special chars



    crossposted in '[info]'php '[info]'mysql & '[info]'bobalien

    Source: http://www.livejournal.com/community/mysql/67585.html

  15. php, mysql search engine

    Date: 09/07/05 (PHP Community)    Keywords: cms, php, mysql, html, sql

    Ok, I’m trying to make a nice little search script for my CMS. The whole site is in the db, and I would like to have a way for people to be able to search all the content. Each entry in the db has an id, name, title, description and body. They may all contain html. now I would like to run a query that looks through all the fields (except the id) and pulls out all those that match, then display them in a table (I assume a while loop is fie for this). So what I'm really looking for is an sql query that will search all the fields. Now I would also like it to recognise boolean searches if this is possible.

    Ok, I’m sure you get the idea by now. Does anyone know how this might be achieved? Please note, my php knowledge is about a year old and my mysql is very poor. I have also been through mysql docs (mainly this page, but have found it s little beyond me).

    Thanks for any help

    x-posted to '[info]'mysql

    Source: http://www.livejournal.com/community/php/341853.html

  16. zip codes

    Date: 09/07/05 (PHP Community)    Keywords: php, mysql, html, database, sql

    i'm doing a project where i need to measure distances between zip codes; en route to a solution i stumbled upon a couple of handy resources that i figured i'd pass along:

    http://www.zend.com/codex.php?id=1486&single=1
    a class used to do various zipcode calculations such as distance and finding the zip codes within range of another zip code
    take a look at the class to see how he wants your tables and fields named for the state and zip code database tables

    http://www.cfdynamics.com/cfdynamics/zipbase/index.cfm
    zipbase - datbase of zip codes with lat & long info, state info, etc. available in a text file and an access datbase
    i used the textfile and in mysql said:
    mysql> LOAD DATA LOCAL INFILE 'c:/ZIP_CODES.txt'
    -> INTO TABLE zip_code
    -> FIELDS TERMINATED BY ',' ENCLOSED BY '"'
    -> LINES TERMINATED BY '\r\n';

    http://27.org/isocountrylist/usps_states_list.sql
    SQL file for creating a states table (i believe in the zipcode class, he wants the states table called "state")

    i used that to make a silly little app to test some of the features of the class:

     $zip){
    		$field = 'zip'.($key+1);
    		if(isset($_REQUEST[$field])){
    			if(is_numeric($_REQUEST[$field])){
    				$zips[$key] = $_REQUEST[$field];	
    			}
    		}
    	}
    	
    	
    
    ?>
    
    " method="GET"> " /> " />
    $zip){ if($zip){ echo "
      "; echo "$zip:"; $details = $zc->get_zip_details($zip); if(!empty($details)){ foreach($details as $key => $value){ echo "
    • $key: $value
    • "; } } echo "
    "; } } ?>
    get_distance($zips[0], $zips[1]); } ?>


    oh, and i found this http://centricle.com/tools/html-entities/ to convert app code into HTML special chars



    crossposted in '[info]'php '[info]'mysql & '[info]'bobalien

    Source: http://www.livejournal.com/community/php/341574.html

  17. mass email program...

    Date: 09/07/05 (WebDesign)    Keywords: database, sql

    Hey.. random question..

    does anyone know a mass email program.. such as maybe dada mail but that i can import addresses from a sql database?

    Source: http://www.livejournal.com/community/webdesign/972640.html

  18. MSSQL scares me

    Date: 09/08/05 (SQL Server)    Keywords: mysql, database, sql, postgresql, web, linux, microsoft

    (my background)
    Using MySQL and PostgreSQL on FreeBSD and Linux machines
    (the problem)
    I have four databases (actually MDF and LDF files) from a client. They want to know if they can extract data from the four databases by year and place them in to individual databases. This sounds ok, but I am new to Microsoft's SQL server. I sacrificed one of my personal dev machines and installed 2k3 Enterprise and 2000 SQL server. Created new databases with the same name as the files and then replaced the new files with the original ones from the client. Super.
    Now what?

    Again my background is in the command line/web front end so I am running a little blind. What is the simplest way to see the data in each database? What are some _quality_ sites I can read (because googling information you have no idea about takes time to filter out the bs).

    Source: http://www.livejournal.com/community/sqlserver/33194.html

  19. gmui/php probs

    Date: 09/09/05 (Computer Geeks)    Keywords: php, mysql, sql, apache

    I'm having trouble getting gmui to work properly. I have MySQL and Apache2 running fine behind it, but I just get this:

    Warning: displaysite(/var/www/localhost/gmui/./themes/default/template.php): failed to open stream: No such file or directory in /var/www/localhost/htdocs/gmui/class/Core.php on line 369

    EDIT:
    This is Line 369:
    require_once($this->gmui_dir.$this->subDirs['theme_dir'].$_SESSION['user']->theme."/template.php");




    * @author Don Seiler
    */
    class Core {

    /*
    * The version of GMUI
    */
    var $version;

    /*
    * Array containing settings for GMUI from conf.php
    */
    var $settings = array();

    /*
    * Array containing all CORE_OP
    * where the page refresh should enabled
    */
    var $pageRefresh = array("vd", "servers", "upl");

    /*
    * all available GMUI panels which are optional when mldonkey is running/off
    *
    */
    var $clientUpPanels = array("vd" => "Downloads", "s" =>"Search", "dllink" => "Links",
    "upl" => "Uploads", "upstats" => "Statistics", "servers" => "Servers", "shares" => "Shares",// "vfr" => "Friends",
    "cmd" => "Console", "opt" => "Client Options", "uopt" => "User Options",
    "umanage" => "Users", "gmanage" => "Groups", "other" => "Other", "inc" => "Incoming", "kill" => "Kill Client", "logout" => "Logout");

    var $clientDownPanels = array("umanage" => "Users", "gmanage" => "Groups",
    "other" => "Other", "uopt" => "User Options", "inc" => "Incoming",
    "start" => "Start Client", "logout" => "Logout");

    /*
    * GMUIs subdirectories
    */
    var $subDirs = array( "conf_dir" => "./conf/",
    "lang_dir" => "./lang/",
    "theme_dir" => "./themes/",
    "client_dir" => "./client/",
    "bin_dir" => "./bin/",
    "lib_dir" => "./lib/");
    /*
    * GMUIs priority mapping
    */
    var $priorities = array();

    /*
    * reload id
    */
    var $refreshed = FALSE;

    /*
    * client stat
    */
    var $alive;

    /*
    * settings from conf.php
    *
    */
    var $gmui_dir;
    var $gmui_http;

    var $client_basedir;
    var $client_startup;
    var $client_incoming;

    var $min_page_refresh;
    var $data_sync_time;
    var $use_javascript;
    var $allow_http_download;
    var $allow_http_upload;
    var $max_upload_size;
    var $make_commit_script;
    var $use_hard_links;
    var $include_incoming_size;
    var $max_displayed_sources;
    var $max_displayed_names;
    var $content_src;
    var $use_http_auth;
    var $use_db;
    var $sqlite_db_file;

    var $mysql_user;
    var $mysql_passwd;
    var $mysql_host;
    var $mysql_db;

    /*
    * use php file functions, workaround for file too big errors
    */
    var $use_php_ff;

    /**
    * Constructor for Core class
    *
    * Loads all settings and initializes what is needed.
    */
    function Core()
    {
    $this->loadSettings();
    $this->checkSettings();
    }
    /*
    * hack to use settings during Core Object is created
    */
    function postInit()
    {
    $this->setVersion();
    $this->setInterface();
    $this->setDataBase();
    $this->setPriorities();
    }

    function setPriorities() {
    $this->priorities = array(
    "-20" => _("Very Low"),
    "-10" => _("Low"),
    "0" => _("None (priority)"),
    "10" => _("High"),
    "20" => _("Very High")
    );
    }

    /**
    * Get database wrapper Object
    *
    * @author Moritz Warning
    */
    function setDataBase() {
    require($this->subDirs['conf_dir']."config.php");

    if($use_db == "sqlite") {
    $_SESSION['db'] = new SQLite($sqlite_db_file);
    } elseif ($this->use_db == "mysql") {
    $_SESSION['db'] = new MySQL($mysql_user, $mysql_passwd, $mysql_host, $mysql_db);
    } else exit(''._("No valid database type selected!")."
    \n");
    }

    /**
    * Get Interface Objekt to get data from MLDonkey
    *
    * @author Moritz Warning
    */
    function setInterface() {
    require($this->subDirs['conf_dir']."config.php");

    $_SESSION['interface'] = new MLD_Interface($client_host, $client_port, $client_user, $client_passwd);
    $_SESSION['interface']->postInit();
    }

    /**
    * Grabs version from VERSION file
    *
    * @author Don Seiler
    */
    function setVersion() {
    if (file_exists("./VERSION")) {
    $lines = file("./VERSION");
    $this->version = $lines[0];
    } else {
    exit(''._("Version File not found!")."
    \n");
    }
    }

    /**
    * Return available languages.
    *
    * @author Moritz Warning
    */
    function getLanguages() {
    return getDirs($this->subDirs['lang_dir']);
    }

    /**
    * Return available themes
    *
    * @author Moritz Warning
    */
    function getThemes() {
    return getDirs($this->subDirs['theme_dir']);
    }

    /**
    * Loads core settings into $this->settings array
    *
    * @author Moritz Warning
    */
    function loadSettings() {
    $conf_file = $this->subDirs['conf_dir']."config.php";
    if (!file_exists($conf_file)) {
    exit(''."Required file conf/config.php not found!"."
    \n");
    }
    require($conf_file);

    //check for optional $gmui_dir in conf.php
    if(!isset($gmui_dir)) {
    $this->gmui_dir = dirname($_SERVER["DOCUMENT_ROOT"].$_SERVER["PHP_SELF"]).DIRECTORY_SEPARATOR;
    } else {
    $this->gmui_dir = $gmui_dir;
    }

    //check for optional $gmui_http in conf.php
    if(!isset($gmui_http)) {
    $this->gmui_http = dirname("http://".$_SERVER["SERVER_ADDR"].":".$_SERVER["SERVER_PORT"].$_SERVER["PHP_SELF"]).DIRECTORY_SEPARATOR;
    } else {
    $this->gmui_http = $gmui_http;
    }

    //needed settings in ./conf/conf.php
    $this->client_basedir = $client_basedir;
    $this->client_startup = $client_startup;
    $this->client_incoming = $client_incoming;
    $this->data_sync_time = $data_sync_time;
    $this->min_page_refresh = $min_page_refresh;
    $this->use_javascript = $use_javascript;
    $this->allow_http_download = $allow_http_download;
    $this->allow_http_upload = $allow_http_upload;
    $this->max_upload_size = $max_upload_size;
    $this->make_commit_script = $make_commit_script;
    $this->chmod = $chmod;
    $this->use_hard_links = $use_hard_links;
    $this->include_incoming_size = $include_incoming_size;
    $this->max_displayed_sources = $max_displayed_sources;
    $this->max_displayed_names = $max_displayed_names;
    $this->content_src = $content_src;
    $this->use_http_auth = $use_http_auth;
    $this->use_db = $use_db;
    $this->use_php_ff = $use_php_ff;

    //other settings, depend on others
    if($use_db == "sqlite") {
    $this->sqlite_db_file = $sqlite_db_file;
    } elseif($use_db == "mysql") {
    $this->mysql_user = $mysql_user;
    $this->mysql_passwd = $mysql_passwd;
    $this->mysql_host = $mysql_host;
    $this->mysql_db = $mysql_db;
    }
    }

    function checkSettings() {
    $check_settings = array(
    'client_basedir',
    'client_startup',
    'client_incoming',
    'min_page_refresh',
    'data_sync_time',
    'use_javascript',
    'allow_http_download',
    'allow_http_upload',
    'max_upload_size',
    'make_commit_script',
    'use_hard_links',
    'include_incoming_size',
    'max_displayed_sources',
    'max_displayed_names',
    //'content_src', this may be empty b y purpose
    'use_http_auth',
    'use_db'
    );

    foreach ($check_settings as $setting) {
    $value = $this->{$setting};
    if (is_null($value) or $value === "") {
    $missingsettings[] = $setting;
    }
    }

    if(count($missingsettings) > 0) {
    $errorstring = "

    \nConfig file incomplete. The following values are missing:
    \n

      \n";
      foreach ($missingsettings as $setting) {
      $errorstring .= "
    • $setting
    • \n";
      }
      $errorstring .= "
    \n

    \n";
    $errorstring .= "If you have recently upgraded, please check config.php.sample for any new settings.\n";
    exit($errorstring);
    }
    }

    /**
    * Lets you know if a menu item is currently active
    *
    * @author CJ Kucera
    */
    function isMenuActive($menu)
    {
    return ($_SESSION["active"] == $menu);
    }

    /**
    * Returns a list of available menu items, for themes
    *
    * @author Moritz Warning
    */
    function getMenu() {
    $menu = array();
    $panels = array();

    if($this->alive) { $panels = $this->clientUpPanels; }
    else { $panels = $this->clientDownPanels; }

    foreach($_SESSION['user']->titlebar as $id) {
    if(isset($panels[$id])) {
    $menu[] = new MenuItem($id, _($panels[$id]), $this->isMenuActive($id));
    }
    }
    return $menu;
    }

    /*
    * this function print the entire site using getSite() in themes/template.php
    *
    * Moritz Warning
    */
    function displaySite() {
    $this->setConstants();
    $this->setAlive();
    $this->setLanguage();
    $this->setTimeMark();

    //update users downloads and settings
    if($this->timemark) {
    $_SESSION['user']->refill_settings();
    $_SESSION['user']->refill_downloads();
    }

    require_once($this->gmui_dir.$this->subDirs['theme_dir'].$_SESSION['user']->theme."/template.php");
    echo getSite(); //getSite is part of the theme

    //reset text variables
    $_SESSION['title'] = "";
    $_SESSION['message'] = "";
    $_SESSION['headline'] = "";

    exit();
    }

    //$this->subDirs
    /*
    * set constants
    *
    * Moritz Warning
    */
    function setConstants() {
    define("NL", "\n");
    define("BN", "
    \n");
    define("BBN", "

    \n");
    }

    /*
    * set alive status of the client
    *
    * Moritz Warning
    */
    function setAlive() {
    $this->alive = $_SESSION['interface']->alive();
    }


    /*
    *
    set gettext variables
    *
    * Moritz Warning
    */
    function setLanguage() {
    $lang = $_SESSION['user']->lang;

    if($lang == "en") {
    setlocale(LC_ALL, 'en_US');
    } else {
    setlocale(LC_ALL, $lang."_".strtoupper($lang));
    }
    putenv("LANG=".$lang);
    bindtextdomain('messages', $this->subDirs['lang_dir']);
    textdomain('messages');
    }

    /*
    * set $this->timemark every $data_sync_time seconds (set in config.php)
    *
    * Moritz Warning
    */
    function setTimeMark() {
    $this->timemark = FALSE;
    if(!isset($_SESSION['last_time_check']) OR (time() - $_SESSION['last_time_check']) > $this->data_sync_time) {
    $_SESSION['last_time_check'] = time();
    $this->timemark = TRUE;
    }
    }

    /**
    * Reads $_REQUEST var and takes appropriate action
    *
    * @author Don Seiler
    * @author Moritz Warning
    */
    function getBody() {

    $core_op = $_REQUEST["CORE_OP"];

    if(!$this->alive) {
    $_SESSION['was_dead'] = TRUE;
    }

    list($prefix,$suffix) = explode("_", $core_op);
    //set CORE_OP if it is not valid
    if(!$_SESSION['user']->allow_show_Menu($prefix)) {
    if(!empty($core_op)) {
    $core_op = "";
    $prefix = "";
    } elseif($this->alive AND $_SESSION['user']->allow_show_Menu("vd")) {
    $core_op = "vd"; //default is CORE_OP when not set and "vd" allowed
    $prefix = "vd";
    }
    }
    $_REQUEST["CORE_OP"] = $core_op; //reset core_op because other programms use it

    $this->dbCare();

    //select availabel panels
    $panels = array();
    if($this->alive) { $panels = $this->clientUpPanels; }
    else { $panels = $this->clientDownPanels; }

    if(function_exists($core_op)) {
    $_SESSION["title"] = "Web-GMUI: ".$panels[$prefix];
    $_SESSION["active"] = $prefix;
    $content = call_user_func($core_op);
    } else {
    $_SESSION["title"] = "Web-GMUI: "._("Welcome");
    $_SESSION["active"] = "";
    $content = "";
    }
    return $content;
    }

    /*
    * dbCare check if mlnet was restarted and initiate an auto reassignment program (verify_db)
    *
    * Moritz Warning
    */
    function dbCare() {
    $restarted = FALSE;

    if($this->alive AND $_SESSION['was_dead']) {
    $restarted = TRUE;
    $_SESSION['was_dead'] = FALSE;
    }

    if($this->alive AND !$restarted AND ($_REQUEST["CORE_OP"] == "vd")) {
    $restarted = $_SESSION['interface']->check_MLDrestart();
    }

    if($restarted) {
    $check_all = FALSE;
    if($_SESSION['user']->username == "admin") { $check_all = TRUE; }

    $_SESSION['user']->verify_db($check_all);
    $_SESSION['user']->refill_downloads();
    } elseif($this->alive AND $this->timemark) {
    $_SESSION['user']->remove_finished();
    }
    }

    /*
    * logout - what should i say any more? ;)
    *
    * Moritz Warning
    */
    function logout() {
    //for gettext tool
    _("Logout");

    $_SESSION['user']->search_delAll();
    unset($_SESSION);
    session_destroy();
    if($this->use_http_auth) { //send a 401 to clear the browser cache
    Header('WWW-Authenticate: Basic realm="Logout"');
    Header('HTTP/1.0 401 Unauthorized');
    }
    }
    }
    ?>


    x-posted to #linux and #computergeeks

    Source: http://www.livejournal.com/community/computergeeks/771090.html

  20. Microsoft to hand out early code

    Date: 09/11/05 (Application Development)    Keywords: sql

    Developers conference attendees will get latest "build" of Vista and nearly finished versions of SQL Server and Visual Studio 2005.

    Source: http://news.zdnet.com/Microsoft+to+hand+out+early+code/2100-9593_22-5859270.html?part=rss&tag=feed&subj=zdnn

Previous page  ||  Next page


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home