vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Add-On Releases - Limited Guest Viewing -- Motivate Guests to Register (https://vborg.vbsupport.ru/showthread.php?t=178720)

Ted S 04-20-2009 03:54 PM

You need to add // before $db->reporterror = 0;

For example // $db->reporterror = 0;

This will keep error debugging on and let you understand why the table is not being created.

mariocaz 04-20-2009 04:01 PM

Ok, like this?

Code:

                                // check if mod is already installed
                               
                                //$db->reporterror = 0;
                                $lgvtbl = $db->query_first("SELECT COUNT(id) as lgv FROM ". TABLE_PREFIX ." lgv");
                               
                                if (!$lgvtbl['cnt']){
                                       
                                        // create the table                                                                               
                                        $db->query_write("CREATE TABLE ". TABLE_PREFIX ." lgv (
                                                  id smallint(5) unsigned NOT NULL auto_increment,
                                                  ipaddress VARCHAR(25) NOT NULL default '0.0.0.0',
                                                        firstaccess INT UNSIGNED NOT NULL DEFAULT '0',
                                                        views INT(4) NOT NULL DEFAULT '0',
                                                        lastactivity INT UNSIGNED NOT NULL DEFAULT '0',
                                                  PRIMARY KEY (id),
                                                  KEY indexs (ipaddress,views,lastactivity)
                                                ) TYPE=MyISAM
                                        ");
                                       
                                        // insert the first record
                                        $db->query_write("
                                                INSERT INTO " . TABLE_PREFIX . "lgv SET
                                                ipaddress =  '123.456.789.012',
                                                firstaccess  = ". TIMENOW .",
                                                views = 1,
                                                lastactivity = ". TIMENOW ."
                                        ");
                                                                       
                                        echo "<font size=\"1\">Added mySQL Tables</font><br /><br />";
                                       
                                } else {                                       
                                        echo "mySQL table already exists.";                                       
                                }


mariocaz 04-20-2009 04:04 PM

And then reinstall the product file ??

Ted S 04-20-2009 09:08 PM

Yes and yes.

mariocaz 04-20-2009 09:11 PM

Ok I will do it in this moment and then tell you the results.

mariocaz 04-20-2009 09:15 PM

Ok I put the // there, I reinstalled the product (rewrite) and I enable the DB option in the configuration panel of the mod and I am receiving this error by email:

Code:

Database error in vBulletin 3.7.6:

Invalid SQL:

                        SELECT id,views
                        FROM vblgv AS lgv
                        WHERE lgv.ipaddress = '85.55.19.137';

MySQL Error  : Table 'allreef_inicio.vblgv' doesn't exist
Error Number  : 1146
Request Date  : Monday, April 20th 2009 @ 06:14:07 PM
Error Date    : Monday, April 20th 2009 @ 06:14:07 PM
Script        : http://www.all-reefs.com/inicio/showthread.php?t=5665
Referrer      : http://www.all-reefs.com/inicio/forumdisplay.php?f=33
IP Address    : 85.55.19.137
Username      : No Registrado
Classname    : vB_Database
MySQL Version :


mariocaz 04-20-2009 09:16 PM

Is the same error like the first time. So the table doesn´t exist in my forum.

mariocaz 04-20-2009 09:17 PM

How can I creat it manually ?

Ted S 04-21-2009 03:24 AM

Run the code

Code:

CREATE TABLE vblgv (
                                                  id smallint(5) unsigned NOT NULL auto_increment,
                                                  ipaddress VARCHAR(25) NOT NULL default '0.0.0.0',
                                                        firstaccess INT UNSIGNED NOT NULL DEFAULT '0',
                                                        views INT(4) NOT NULL DEFAULT '0',
                                                        lastactivity INT UNSIGNED NOT NULL DEFAULT '0',
                                                  PRIMARY KEY (id),
                                                  KEY indexs (ipaddress,views,lastactivity)
                                                )


mariocaz 04-21-2009 03:33 AM

Let me do it !!!


All times are GMT. The time now is 12:37 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01588 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete