View Single Post
  #242  
Old 06-10-2007, 05:02 AM
jklap jklap is offline
 
Join Date: May 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Joel,

Sure, my g2 and vb are in separate folders-- the trick is that global.php sets up CWD as the current working directory-- and if you are calling/including global.php from outside of the vb directory you have a problem. I made a change to global.php:

Code:
if( !defined(CWD) ) {
   define('CWD', (($getcwd = getcwd()) ? $getcwd : '.'));
}
And then in my embed code (most people here seem to be naming their embed file gallery2.php), I simply do the following:

Code:
define('CWD', '/var/www/html/vb');
require_once(CWD . '/global.php');
Then, continuing on, I include g2 stuff:

Code:
require_once('/var/www/html/g2/embed.php');
Then you init as usual and go on your merry way.

Also, I've noticed that if you are including vb SIMPLY so you can use $vbulletin->userinfo['userid'] to pass into g2, you do not seem to need to include vb/global.php, you can include vb/includes/init.php instead-- it's faster as it doesn't load up a bunch of stuff not needed.

Another side note. If you want to make sure that accessing g2 pages keeps the vb session alive, include the vb stuff as mentioned above, but also make sure to call exec_shut_down() near the end of your script-- this makes vb flush out the session to the db, which then keeps the session alive.

I should note though that I'm not using the vb templating system (fetch_template('gallery2')) to accomplish my display (as this thread discusses). Instead, I simply take the output from the runGallery() call and embed it directly in html in the same script. My script ends up looking like this (obviously pseudocode):

Code:
  set THIS_SCRIPT
  include vb/includes/init.php
  include g2/embed.php
  get userid from $vbulletin->userinfo['userid']
  GalleryEmbed::init( 'embedUrl' => '<<points to this script such as /regstuf/g2.php>>'
    'g2Url' => '<<points to url for g2 directory such as /g2/'
    'activeUserId' => $userid
  )
  $data = GalleryEmbed::handleRequest();
  check isDone, if so, return
  parse header  into javascript,title and css

  <html>
  <head>
  echo $data['javascript']
  echo $data['css']
  </head>
  <body>
  stuff......
  echo $data['bodyHtml']
  </body>
  </html>

  exec_shut_down();
The above is the basics, you should also include error checking and such, I just didn't bother typing.

Also, this works in 3.6.6, 3.6.7 and 3.6.7 PL1

Before you ask me a question, make sure you read this whole thead, cause if you ask something dumb that can be answered by looking at the code or reading this thread like 'what do you mean by set THIS_SCRIPT' or how do you do 'set THIS_SCRIPT, I will ignore you. Think before you ask.



Next....



Looks to me like file access permission errors. Maybe your webserver can no longer can write to your g2data directory?

Your last error leads me to believe your plugins have a path to your embed.php file and embed.php is no longer where it should be.

Look at the paths in the errors and figure out what it's complaining about-- it's all there.


Quote:
Originally Posted by scan-pa View Post
I updated the forums to 3.6.7pl and all I get are errors now.

How do I remove everything to do with this mod and gallery 2

here is some of the errors I get when people come to my forum main page and forum index page and admin login page:

Warning: rename(/tmp/0.incndrdBN,/home/centram2/CPAg2data/cache/module/thumbnail/0/0/0.inc) [function.rename]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.incjeNH1a,/home/centram2/CPAg2data/cache/module/rss/0/0/0.inc) [function.rename]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.incJIcqty,/home/centram2/CPAg2data/cache/module/panorama/0/0/0.inc) [function.rename]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.inczi6mWV,/home/centram2/CPAg2data/cache/module/publishxp/0/0/0.inc) [function.rename]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 624

Warning: rename(/tmp/0.inc53owqj,/home/centram2/CPAg2data/cache/module/sizelimit/0/0/0.inc) [function.rename]: Permission denied in /gallery2/modules/core/classes/GalleryPlatform.class on line 487

Warning: mkdir(/home/centram2/CPAg2data/cache) [function.mkdir]: Permission denied

-----------------------------------------------------------------------------

I just want to delete this whole mess and remove it from the system.

Any advice on doing that to restore my forums?

also getting these errors:

Warning: Unknown(/home/centram2/public_html/forum/gallery2/embed.php): failed to open stream: No such file or directory in /includes/class_dm_user.php(1668) : eval()'d code on line 1
Fatal error: (null)() [function.require]: Failed opening required '/home/centram2/public_html/forum/gallery2/embed.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/centram2/public_html/forum/includes/class_dm_user.php(1668) : eval()'d code on line 1
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01089 seconds
  • Memory Usage 1,808KB
  • 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
  • (4)bbcode_code
  • (1)bbcode_quote
  • (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