Welcome to Geeklog, Anonymous Saturday, November 23 2024 @ 12:45 pm EST

Geeklog Forums

gl_vars


Status: offline

eyecravedvd

Forum User
Full Member
Registered: 06/09/03
Posts: 152
I have multiple external page wrapped in GL by echo-ing the header, start_block, end_block, and footer.

I'm experiencing an issue with just one of them. First let me explain that I have two different DBs, one for GL, and the other for the DVD DB. Now the page I'm having trouble with is my DVD Review/Easter Egg page.

The footer.thtml will not be called. I moved the closing code

Text Formatted Code
echo COM_endBlock();
echo COM_siteFooter(false);
 


into a different file, where it could closed as well, and I got an SQL error. When I pulled it up it had this:

Fri 17 Mar 2006 19:20:55 EST - 1146: Table 'dvddbname.gl_vars' doesn't exist. SQL in question: UPDATE gl_vars SET value = value + 1 WHERE name = 'totalhits'

Which for some reason is calling my DVD DB and not GL, but only on this page. So, when I finally figured out where this was being called from I commented out this line of code

Text Formatted Code
// DB_change( $_TABLES['vars'], 'value', 'value + 1', 'name', 'totalhits', '', true );
 


Bam. The footer.thtml loaded just fine. I can't find any line of code that has a similiar function as GL, and it works on other DB driven pages without that error. What will happen if I disable that line of code, or can someone help me figure out why it's looking at the wrong DB?

oh BTW - I do call lib-common.php in the /dvd/index.php
Shane | www.EyeCraveDVD.com
 Quote

Status: offline

eyecravedvd

Forum User
Full Member
Registered: 06/09/03
Posts: 152
What is gl_vars for. If I turn it off will it break anything?
Shane | www.EyeCraveDVD.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
gl_vars is a general purpose table to store (name, value) pairs. The number of total hits on your Geeklog site is stored there, the last time the daily digest was sent, etc. Some plugins also use it store information there.

bye, Dirk
 Quote

Status: offline

n4th4n

Forum User
Chatty
Registered: 07/21/03
Posts: 49
Location:NY, USA
I just upgraded an old 1.3.9 install to 1.5 and I have a lot of custom code in it. I get the following error on static PHP pages that have a call to a database other than the geeklog db:
Text Formatted Code
An SQL error has occurred. Please see error.log for details.


Text Formatted Code
Table '(my other db).gl_vars' doesn't exist. SQL in question: UPDATE gl_vars SET value = value + 1 WHERE name = 'totalhits'

What's the best way to handle this? Should I add a gl_vars table to that db or is there an easy way to disable updating page hits for a certain page so the error doesn't occur?

Nate

[update: I copied gl_vars, gl_blocks, gl_staticpage to the other database and my custom code is working fine. Seems like a better solution would be to pop up a warning on the page that hits are not being registered for the page and the reason why, but no big deal]
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: n4th4n

I get the following error on static PHP pages that have a call to a database other than the geeklog db


Sounds messy. Make sure that the db connection used in the static page is separate from the one Geeklog uses. Which means that you should not use Geeklog's DB_xxx functions for that connection.

bye, Dirk
 Quote

All times are EST. The time is now 12:45 pm.

  • 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