The image that i added to album is not showing in album listing


#1

@joshuaabenazer I have inserted the a photo to the rtmedia album through the database manually (into post tabe and then the rtmedia table ). The guid ie image path specified is correct.. but the image is not showing in the album page. Can you please give me solution for that.

Thak you


#2

@stan-reeves-963 - Not sure what exactly are you trying to do here. Could you elaborate a bit on this. Also you are not supposed to modify things in the database this way unless you know what all that change is dependent on or on what all depends on that change.


#3

@joshuaabenazer in the case of album image, which field of the databse holding the image path.


#4

@joshuaabenazer i am waiting for reply.


#5

@stan-reeves-963 - This is a little complicated than you think here and is not at all advisable to be changed through the database. If you want to change an albums cover, use the “Set as Album Cover” button provided on the image that is a part of that particular album whose cover you want to set.


#6

@joshuaabenazer my requirement is as follows. am created default album for all users, named “Squeak” then i want to move the image uploaded to activity stream is need to move to the corresponding user Squeak album. To upload the image from the activity stream uses custom coding. Is it possible to move a image to album using the image path.


#7

@stan-reeves-963 - Since you already have rtMedia-Pro, you can do the following.

You should have an option for creating a new global album in the rtMedia settings. Create a new global album by the name of “Squeak” there and select it to be the default global album. Once this is done, media uploaded through the activity should automatically go to this album.


#8

@joshuaabenazer but for uploading the images in the activity stream am not using the rtmedia uploader it is a different one (my own custom uploading function ).


#9

@stan-reeves-963 - Check the ‘rt_rtm_media’ table and you should see a column ‘album_id’ in it. Here is where the album of a media is decided. This album_id corresponds to the rtMedia album id which is the ‘id’ column of the same table.


#10

Hey, that is the exact same issue we running into now!

Joshua let me try to explain:

We created a import script to import data from PhotoPost (a PHP Gallery Script) to rtMediaPro. We checked (like stan) the differences to the database when you add an image through rtMediaPro.

Now our Script is working, since you see the imported Media on the “Shortcode Page” ([rtmedia_gallery global=“true” media_type=“photo”]) with correct title, permalink, user etc., but on the user profile page the Tab “Media” shows f.e 2 but no Media is shown. Neither under Media (All) or Media (Albums). The correct Album ID is set, its even recognized correctly in the lightbox -> Header $title under $album_name.

The only difference between manually uploaded and db inserted images is actually the _wp_attachment_meta Data. The Metadata inserted via rtMediaPro has less fields. But the rt_media_thumbnail stuff is also included in the manually inserted entries.

So we “Importers” seem to miss something here, hope you can help :slight_smile:

EDIT: Btw our script uses following wordpress functions to handle the attachments: wp_insert_attachment() / wp_generate_attachment_metadata() and wp_update_attachment_metadata()


#11

Hi Eleonore,

I think it’s context which creating an issue here. Only media with context set to profile will shown under media tab.


#12

Hi Ritesh,

the context is set to profile, here is my insert array:

$wpdb->insert(   
	'wp_rt_rtm_media',   
	array(   
		'id' 				=> '',  
		'blog_id' 			=> 2,  
		'media_id'			=> $attach_id,  
		'media_author'  	=> $wp_user_id,  
		'media_title'		=> $title,  
		'album_id'			=> $rt_media_album,  
		'media_type' 		=> 'photo',  
		'context' 			=> 'profile',  
		'context_id' 		=> 1,  
		'source' 			=> NULL,  
		'source_id' 		=> NULL,  
		'activity_id' 		=> '',  
		'cover_art' 		=> NULL,  
		'privacy' 			=> 0,  
		'views' 			=> 0,  
		'downloads' 		=> 0,  
		'ratings_total' 	=> 0,  
		'ratings_count' 	=> 0,  
		'ratings_average' 	=> 0.00,  
		'likes' 			=> 0,  
		'dislikes' 			=> 0,  
		'upload_date' 		=> $date,  
		'file_size' 		=> $filesize,  

context_id schould be 1 for profile right?


#13

context_id should be user id.


#14

Thanks! Now it works like a charm :slight_smile:


#15

I’m glad to know that :slight_smile:


#16

what if you I want to migrate my website to new website witch has same album with 1000000 of images do I need to do it in website? of-course in database and upload the images in the folder


#17