Go Back   vb.org Archive > vBulletin 5 Connect Discussion > vB5 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-26-2014, 05:04 PM
pyro2927 pyro2927 is offline
 
Join Date: Oct 2013
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Migrate Photoplog to vB5

I'm working on a script to migrate existing Photoplog pictures to vBulletin 5 photos/albums. It looks like each element in vB5 is a node, and the photo table links an entry on filedata and a node.

I have userids, descriptions, and files currently in place. I've been able to import the files into the filedata table by using LOAD_FILE() in MySQL, but I haven't been able to get the photos to show up on the user's profile page. I am attempting to create an Album node, and it appears in the database and is assigned to the correct userid, but it doesn't show up on their page.

Here is the script I've been working on:
http://hastebin.com/vulefepega.rb
Reply With Quote
  #2  
Old 03-26-2014, 11:04 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't see you inserting the data into the photo or gallery tables. filedata basically has the image data for every file, but photo has the nodeid for each along with any caption. And then gallery keeps track of everybodies 'galleries' (a person may have several galleries each for a different subject).

So, say I have three 'galleries' in my media tab, like this:

Cats
- image 1
- image 2
Dogs
- image 3
- image 4
Favorite Images
- image 1 (again)
- image 4 (again)

That is four different entries into the filedata table (for four different images)
That is six different entries into the photo table (for each time the image is used)
That is three different entries into the gallery table (for the three galleries for this user)
That is nine different entries into the node table (for the three galleries and the six photos)

I hope that helps out.
Reply With Quote
  #3  
Old 03-29-2014, 11:55 PM
pyro2927 pyro2927 is offline
 
Join Date: Oct 2013
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think that helps get me on the right track, thanks!

I've added a gallery in as a node and as by adding an entry under the "gallery" table, linking the newly created nodeid. The node is assigned to my userid and has a routeid of 50 and a contenttypeid of 22. The gallery I created through the UI seems to have similar values, yet this hand-inserted one is not showing up on my user page. Any idea on why that might be? Pasted below is the entry:

Code:
nodeid	routeid	contenttypeid	publishdate	unpublishdate	userid	groupid	authorname	description	title	htmltitle	parentid	urlident	displayorder	starter	created	lastcontent	lastcontentid	lastcontentauthor	lastauthorid	lastprefixid	textcount	textunpubcount	totalcount	totalunpubcount	ipaddress	showpublished	oldid	oldcontenttypeid	nextupdate	lastupdate	featured	CRC32	taglist	inlist	protected	setfor	votes	hasphoto	hasvideo	deleteuserid	deletereason	open	showopen	sticky	approved	showapproved	viewperms	commentperms	nodeoptions	prefixid	iconid
650540	50	22	1396136765	NULL	1750	NULL	BlueGT88	NULL	Photoplog Migration	Photoplog Migration	9	photoplog_migration	NULL	649830	1396136765	1396136765	649830	BlueGT88	1750		0	0	0	0		1	NULL	NULL	NULL	NULL	0		NULL	1	0	0	0	0	0	NULL	NULL	1	1	0	1	1	2	1	138		0
Update: Looks like the previous script isn't loading anymore, here is the updated one:
http://pastie.org/private/pcvethjqfi60yivnzegwa
Reply With Quote
  #4  
Old 03-30-2014, 05:34 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you make sure to go to Maintenance > Clear System Cache after you added your stuff to the database?

And, I forgot to mention... the closure table. (Honestly, I try to forget about that table!).

Every one of your nodes will have at least one row in there. For Galleries, they will have one for themselves and each photo in it.
parent: 650540
child: 650540
depth: 0
display order: 0
publishdate: 1396136765

Then say you have a photo with nodeid x in that gallery (same publish date):
parent: 650540
child: x
depth: 1
display order: 0
publishdate: 1396136765

AND, a row for itself:
parent: x
child: x
depth: 0
display order: 0
publishdate: 1396136765
Reply With Quote
  #5  
Old 03-31-2014, 02:10 PM
pyro2927 pyro2927 is offline
 
Join Date: Oct 2013
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, totally didn't know about the closure table! Maybe that's the piece I've been missing! I'll work on that and see if it works, thank you so much!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:54 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.03669 seconds
  • Memory Usage 2,197KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete