Thread: Major Additions - VBGooglemap Member Edition
View Single Post
  #248  
Old 01-27-2007, 04:59 PM
bulbasnore bulbasnore is offline
 
Join Date: Dec 2004
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, this is working pretty well in test for us on vB 3.6.4 (Apache2/PHP5/MySQL5/Linux). We have these exceptions:
- Picture display comes and goes. Sometimes scrolling the map helps?
- Some members don't see the pins or links above the on map certain computers.

My advice to those having complete problems (no display) is: recapitulate the install and make sure the cron task is working. That advice may be worth nothing. I can't support the add-on for you any further. As always, the more details you post, the more likely you are to get help. If it was me, I'd post: O/S, vB & add-on versions plus file locations uploaded, plus cron task log.

UM, anyway...

I was sorry to see Stonyarc gave up the avatar load for the pictures, though I could guess why. We have a PG-rated board and like to keep some control on the picture displays. Consequently, I hacked together the script below to ensure that the avatar pic is what is displayed for the vbgooglemapme pin image.

This might only work if you have set your avatars to be stored in your database as opposed to your filesystem. If you don't understand what that is, or the issues surrounding that choice, go to the vBulletin documentation and look it up before you go on.

OTOH, if someone can tell me I'm wrong about that, then, please hip me to the Truth!

Here's the script - you could destroy your database, so don't use it or my instructions unless you know what is happening in the code and take full responsibility for the consequences yourself!!!

Name it something like vbgooglemapme_avatars.php
Upload it to <your forum directory>/includes/cron

PHP Code:
/*======================================================================*\
|| #################################################################### ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2007 Kim Cary                                         # ||
|| # This file may be redistributed in whole or significant part.     # ||
|| # You could signficantly damage or destroy your board or computer  # ||
|| # with this file. Author will not be liable for any damages.       # ||
|| #################################################################### ||
\*======================================================================*/

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!
is_object($vbulletin->db))
{
        exit;
}
// ######################## END PHP ENVIRONMENT ###########################

        
$vbulletin->db->query_write("
                UPDATE " 
TABLE_PREFIX "googlemapme
                SET  `pimage` = concat(  'http://pokegym.net/forums/image.php?u=',  `userid` )
        "
);
        
log_cron_action('Add Avatars to vbgooglemapme picture field'$nextitem);

/*======================================================================*\
|| ####################################################################
|| # Version: 10:12, Sat Jan 27th 2007
|| ####################################################################
\*======================================================================*/ 
Once you've done that, you can set it up to test via a scheduled task, like the thumbnail below. If you set it up this way it will be disabled for schedules, but you can run it on demand for a test.

Now use the Scheduled Task Manager [Run Now] function in your admincp to run this task (because you assumed responsibilty, remember!!!). If you want to see whether it worked, run a sql query like this in your admincp sql query tool:

Code:
SELECT userid,pimage FROM googlemapme ORDER BY userid asc
You should see a list of userids and standard avatar URLs in the result. Of course, if you screw up the query you might have no database left.

If you like what you see, go back to the task in the scheduled task manager and enable it, but change the time you run it to the minute or more before you run Stonyarc's scheduled task.

To be clear again: You can wreck things playing around at this level. If you do, its YOUR fault. My code is NOT authorized by Stonyarc and frankly, I expect him to delete this post when he/she returns. For those who have the skills to deal with this, I hope this helps you. I've been helped so much be vb.org over the years.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01450 seconds
  • Memory Usage 1,790KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete