vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   vBulletin Mail System (https://vborg.vbsupport.ru/showthread.php?t=125890)

DaNIEL MeNTED 11-20-2006 01:06 PM

error when "rebuild quota" -

PHP Code:

Invalid SQL:
DELETE FROM vb_vbms_attachment
            USING vb_vbms_attachment a
            LEFT JOIN vb_vbms_message
            ON a
.messageid vb_vbms_message.messageid
            WHERE vb_vbms_message
.messageid IS NULL;

MySQL Error  Unknown table 'vb_vbms_attachment' in MULTI DELETE
Error Number 
1109 

As far as default aliases... Is there a way to populate the alias column with the members' username - dropping any illegal characters and changing spaces to _ or . ??

Also ... I'd love to be able to see the alias in the AdminCP user properties.

DaNIEL MeNTED 11-20-2006 02:05 PM

Quote:

Originally Posted by Lionel (Post 1121251)
Try to run this in your browser and post the results if any (replace with your values)

http://www.yoursite.com/forums/vbms_checkmail.php

Is there a reason we can't create a cron job for vbms_checkmail.php instead of using the plugins?

I just think a cron is more "standard" as to the way most hacks run. Or is there a reason its in the plugins?

dodgeboard.com 11-20-2006 03:14 PM

Quote:

Originally Posted by DaNIEL MeNTED (Post 1121521)
error when "rebuild quota" -

PHP Code:

Invalid SQL:
DELETE FROM vb_vbms_attachment
            USING vb_vbms_attachment a
            LEFT JOIN vb_vbms_message
            ON a
.messageid vb_vbms_message.messageid
            WHERE vb_vbms_message
.messageid IS NULL;

MySQL Error  Unknown table 'vb_vbms_attachment' in MULTI DELETE
Error Number 
1109 

As far as default aliases... Is there a way to populate the alias column with the members' username - dropping any illegal characters and changing spaces to _ or . ??

Also ... I'd love to be able to see the alias in the AdminCP user properties.


I had this problem too. Lionel corrected it by manually creating the table.

Lionel 11-20-2006 04:08 PM

change

Quote:

DELETE FROM vb_vbms_attachment

to

Quote:

DELETE FROM vb_vbms_attachment a

Lionel 11-20-2006 04:11 PM

Quote:

Originally Posted by DaNIEL MeNTED (Post 1121550)
Is there a reason we can't create a cron job for vbms_checkmail.php instead of using the plugins?

I just think a cron is more "standard" as to the way most hacks run. Or is there a reason its in the plugins?

the way it's setup, it is the same as a cronjob

DaNIEL MeNTED 11-20-2006 05:03 PM

I've imported all the templates and SQL queries into the product...

I've added uninstall code that removes all the tables.

I have also added the following:

ON INSTALL - the ALIAS will be populated for all users with the following in mind:
  • all usernames are converted to lowercase.
  • all characters other than a-z, 0-9, and . (period) are stripped from their username.
  • before an alias is added it is checked against all other aliases in the database, if the alias exists it adds a 1, 2, 3, n. to the end of the alias as required.
Please have a look at this code and tell me if it can be improved - like I said I'm not a coder.

PHP Code:

$allusers $vbulletin->db->query("SELECT * FROM  " TABLE_PREFIX "user"); 

while(
$row mysql_fetch_array$allusers )) {
 
$suffix=1;
 
$username $row['username'];
 
$username strtolower($username);
 
$newalias preg_replace('/\s/''.'$username);
 
$newalias preg_replace('@[^a-z0-9.]@'''$newalias);
 
$dupecheck $vbulletin->db->query("SELECT * FROM  " TABLE_PREFIX "user"); 
 while(
$dupe mysql_fetch_array$dupecheck)) {
  
$existing $dupe['vbms_alias'];
  
$currentuser $dupe['username'];
  if (
$newalias == $existing) {
   if (
$user != $currentuser && $suffix == 1) {
    
$newalias $newalias $suffix++;
   } elseif (
$user != $currentuser && $suffix 1) {
   
$newalias rtrim($newalias"1..9");
   
$newalias $newalias $suffix++;
   } else {
    
$newalias $existing;
   }
  }
 }
$vbulletin->db->query("UPDATE " TABLE_PREFIX "user SET `vbms_alias` = '" $newalias "' WHERE " TABLE_PREFIX 
"user.username ='" $username "' LIMIT 1");


I would rather remove this from the install and modify it into 2 plugins ... one that could be run from the admin CP (Populate Aliases! button) and one that runs as part of a new user registration (after the confirm their address).

Also, I'm not sure how to add the alias fields to the user view in the admin CP... anyone want to point me in that direction?

Oh .... I did change the product version to 2.53 because of the differences in the XML I made.

EDITED TO ASK:

Are there any other changes that need to be made to "mail enable" a user?

DaNIEL MeNTED 11-20-2006 06:31 PM

Quote:

Originally Posted by Lionel (Post 1121624)
the way it's setup, it is the same as a cronjob

Bear with me... since I'm still trying to decipher much of this. But it looks like the way it is setup now requires someone to load a page after the timeout has expired to force an update.

Assuming you have a few hours of downtime when no one is surfing your forum that first person is going to get dinged with a longer wait based on the size of the email that needs to get pulled down.

Can the plugin code just be copied to a new cronjob.php file or would I need to do anything else?

Lionel 11-20-2006 06:34 PM

Quote:

Originally Posted by DaNIEL MeNTED (Post 1121708)
But it looks like the way it is setup now requires someone to load a page after the timeout has expired to force an update.

That's the way that vb cron system is setup. For all crons to work, anyone of them, a page must be loaded.

On another good note, I just learned how to make a product. Since you made one already, I'll move to my next project, which will be vbstocks, a stock market simulator using real data with points money to buy them

DaNIEL MeNTED 11-20-2006 06:45 PM

Quote:

Originally Posted by Lionel (Post 1121711)
That's the way that vb cron system is setup. For all crons to work, anyone of them, a page must be loaded.

Ahhh... gotcha!

Quote:

Originally Posted by Lionel (Post 1121711)
On another good note, I just learned how to make a product. Since you made one already, I'll move to my next project, which will be vbstocks, a stock market simulator using real data with points money to buy them

Haha. Lets make sure all the bugs are ironed out of this one first! :D

Should I have any options in my userCP after installing or are there manual template changes?

Lionel 11-20-2006 06:55 PM

Quote:

Originally Posted by DaNIEL MeNTED (Post 1121719)
Should I have any options in my userCP after installing or are there manual template changes?

What I did was adding them in a dropdown in navbar.
My setup is different as I splitted Quick Links and put some items in the User CP navbar link where they belong. So I would simply recommend to add a new mail link in navbar


All times are GMT. The time now is 09:45 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.01678 seconds
  • Memory Usage 1,772KB
  • 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_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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