Forum Replies Created

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter haltek18

    (@haltek18)

    I was able to get this to work but I had to hire a programmer to get it done. I would recommend finding a freelancer online that can do it for you. It really works wonders.

    Thread Starter haltek18

    (@haltek18)

    I was told I could use switch_to_blog function within my script. I want to switch to blog 5.

    This is the shortcode I use to fetch the user_id, just need to get the site_id passed through it. Would I use switch_to_blog in this case?

    add_shortcode('user_id_favorite_images', 'user_id_favorite_imagesCBF');
    	function user_id_favorite_imagesCBF($atts){
    	    if (is_admin())
    			return;
    					
                extract(
        			shortcode_atts(
        				array(
        					'uid' => ''
        					), 
        					$atts
        			)
    			);
    			
    	    if ( $uid == '' || !($uid > 0) || !($uid >= 1) )
    			return;
    			
    		$curUserID = $uid; 
    		
    		$mam_my_favorite_images_arr = get_metadata('user',$curUserID, 'mam_my_favorite_images_arr', true);
    		
    		$mam_my_favorite_images_arr = $mam_my_favorite_images_arr ? $mam_my_favorite_images_arr : array(); 
    		
    		$media_cats_terms = get_terms( 'media-category');
    	
    		
    		if(count($mam_my_favorite_images_arr) > 0 && !empty( $media_cats_terms ) && !is_wp_error( $media_cats_terms ) ){
    			
    		foreach($media_cats_terms as $media_cat_term){
    				$image_posts = get_posts(
    					array(
    						'posts_per_page' => -1,
    						'post_type' => 'attachment',
    						'tax_query' => array(
    							array(
    								'taxonomy' => 'media-category',
    								'field' => 'term_id',
    								'terms' => $media_cat_term->term_id,
    							)
    						)
    					)
    				); // image_posts
    				//echo '<pre>'; print_r($image_posts); echo '</pre>';
    				if(isset($image_posts[0])){
    				    
    					$gray_counter = 1;
    					foreach($image_posts as $image_post){
    
    					if( false !== array_search($image_post->ID,$mam_my_favorite_images_arr)){
    						$image_id = $image_post->ID;
    						$flag_wrt_img_uid = get_metadata('user',$curUserID, 'favorites_wrt_imageid_'.$image_id.'_uid_'.$curUserID.'_flag', true);
    						$count = get_metadata('post',$image_id, 'simplefavorites_count', true);
    						if($flag_wrt_img_uid && $flag_wrt_img_uid == 'adding_one'){
    							$gray_counter++; 
    							
                                $approveArgs = array('status' => 'approve', 'post_id' => $image_id,'user_id' => $curUserID, 'order'=>'ASC'); 
                                $approveComments = get_comments($approveArgs);
    							//echo '<pre>'; print_r($image_posts); echo '</pre>'
    							 if(isset($category_name) && $category_name == $media_cat_term->name){
    					    } else {
    					        
        					    $category_name = $media_cat_term->name;
        						echo '<h3>'.($media_cat_term->name).'</h3>';
        						echo '<ul class="favorites-list">';
    					    }
    							?>
    					
    						
    						<li class="div_table_li_wrapper" <?php echo ( ($gray_counter % 2 == 0) ? 'style="background-color:#f1f1f1"' : '')?>>
    							<div class="div_table" style="margin-left: 20px;">
    								<div class="table_row">
    									<div class="table_demention_1" valign="top">
    									    <a>" class="mam_mas_fancybox" rel="example_group" href="<?php echo wp_get_attachment_url($image_id)?>"><img />" height="100" width="100" /></a>
    									 </div>
    									<div  class="table_demention_2" valign="top">
    										<div><?php echo get_the_title($image_id) ?></div>
    										<div>&nbsp;</div>
    										<div>
    											<span id="ufi_mam_favorit_wrapper">
    												<span class="sf-icon-spinner-wrapper">
    													<span class="ufi_mam_favorit_count" style="background: #ff7400;color: white;padding: 9px 9px 9px 9px; margin-top: -4px;"><?php echo $count?></span><span style="display:none;" class="sf-icon-spinner"></span></span><span type="button" name="ufi_mam_favorit_clicked" value="<?php echo $image_id?>" class="sf-icon-love ufi_mam_favorit_clicked" style="background: black;padding: 9px 9px 9px 9px;border: none;margin-top: -7px;color: #f87f94;position: absolute"></span>
    											</span>
    										</div>
    									</div>
    								</div>
    							</div>
    				<button style="<?php echo ($approveComments && count($approveComments) > 0 ? '' : 'display:none')?>" class="vc_general vc_btn3 vc_btn3-size-sm vc_btn3-shape-round vc_btn3-style-custom favorites_comments_show_hide">Show/ Hide Comments</button>
                    <div id="comments" class="comments-area favorites_comments_area_block" style="display:none;">								
                        <div class="comment-list">
                    		<?php if(shortcode_exists('sc_divider')) { echo do_shortcode('[sc_divider style="1" color="'.esc_attr(scalia_get_option('divider_default_color') ? scalia_get_option('divider_default_color') : '').'"]'); } ?>
                    		<?php
                    			wp_list_comments( array(
                    				'style'      => 'div',
                    				'short_ping' => true,
                    				'avatar_size'=> 50
                    			),$approveComments );
                    		?>
                    	</div><!-- .comment-list --
                    </div><!-- #comments -->
    						</li>

    Not sure where it’d go.

    • This reply was modified 4 years, 3 months ago by haltek18.
    • This reply was modified 4 years, 3 months ago by haltek18.
    Thread Starter haltek18

    (@haltek18)

    If I’m understanding your question correctly, I believe when you upload the XML file it goes into the secondary site’s wp-content/uploads/site folder.

    Thread Starter haltek18

    (@haltek18)

    So I want to thank you all for your responses. This has all been very educational.

    The good news? I got my question resolved!!! I was was watching YouTube videos on how to set this all up. I now understand that that the subdomain that gets added into my network site needs to be free of a WordPress installation, a database, and needs to be set to /public_html/ and not to a directory within public_html, say /public_html/yoursite within my cPanel.

    It’s now showing the “My Sites” at the top of my dashboard inside this subsite, so I know it’s working!!! Now I can start building this site!!!

    https://youtu.be/JVmfOzAnE7g?t=310

    • This reply was modified 4 years, 4 months ago by haltek18.
    • This reply was modified 4 years, 4 months ago by haltek18.
    • This reply was modified 4 years ago by Jan Dembowski.
    Thread Starter haltek18

    (@haltek18)

    Ok.

    There must be something wrong with Bluehost’s server because it will absolutely not send the request to WP to set up the “virtual” site.

    I wonder what is going wrong because I can never get to that virtual site no matter how many times I try.

    I already have the subdomain propagated but if there is supposed to be no database as well no files in the subdirectory folder then I have no idea how it’s going to create the website after I add the website in the network admin panel without getting a “Not Found” error or this page cannot be located error. If it does have a database and files, and it’s added, it will be treated as an independent single site after it’s added.

    Has anyone successfully installed a subsite on an exising network site in Bluehost? Could the problem be that I’m installing the multisite on an existing website?

    I’ve tried uninstalling the multisite installation three times already. The only tutorials I could have are for fresh installations on the parent sitea and/or ones that used a subdirectory.

    Thread Starter haltek18

    (@haltek18)

    Thank you for your response.

    My question for further clarification on the steps: do I set up the subdomain in my cPanel, wait for it to propagate, add it to the DNS settings so that it points to the parent domain, and then add the site within the network admin? I must not have WordPress installed on this subdomain in order for it to add? Once it’s added, does it somehow install WordPress on that new subdomain where I can access the dashboard?

    Am I correct to to say that the subdirectory or subdomain must not have WordPress installed in order for it to be added successfully as a subdomain to my networked website?

    If the subdomain already has WordPress installed and I want to add it to the main site, do I need to remove the installation and database (back it up of course and export the xml file) and then create an empty site with no installation, and reinstall with the files, database, and the xml file?

    Thread Starter haltek18

    (@haltek18)

    Yes, I am aware that multiple instances of a WordPress site on the same server don’t constitute a multisite network. I have the multisite set up on my main domain, however, it’s confusing to me how to add a subsite through the network super admin panel. How do I install a subsite onto the main site? Tutorials talk about adding an “empty site” and I don’t know what that means. Do I need to set up a subdomain with my cPanel first or do I create a dummy subdomain that hasn’t been set up on the cpanel and then install it through myPHPadmin and my FTP somehow? I tried the first route with setting the subdomain on my cPanel and then adding the site within my network and then installing WordPress in that subdirectory but once everything has propagated, I access the dashboard and it’s being treated as a single independent site, not connected to the multisite, hence no “My Sites” at the top of the dashboard. As far as the second question, I’m confused how that would work because obviously I can’t access the dashboard and import the WordPress site into it if it does not have the subdomain added to the cPanel, if it does not have WordPress installed and hasn’t propagated, right? Then how to add the subsite to the multisite if neither of these work?

    Thread Starter haltek18

    (@haltek18)

    Yeah, I noticed that that video totally glosses over the part about setting up a subdomain on your host, waiting for it to propagate, installing WordPress on that subsite, and then adding it.

    Somehow after they created the site in the network in the video, that site magically appeared (with a fresh WordPress install) after they clicked the dashboard. So I got lost after that step.

    A lot of tutorials gloss over the setting up the subdomain as a part of your host, so it makes it kind of hard to set up.

    I’m trying to follow this tutorial now, which seems to be more thorough:

    https://premium.wpmudev.org/blog/move-wordpress-site-multisite-network/

    It looks like I’ll have to take a more manual approach to this.

    • This reply was modified 4 years, 4 months ago by haltek18.
    Thread Starter haltek18

    (@haltek18)

    I appreciate your responses!

    My main site has already been built out. My subsite has already been built out. I’m trying now to put them all together under a multisite network. Is it possible to merge them together under a multisite by converting my parent site to a multisite? I did try to convert my parent site to a network site, and then add an existing subsite on to it, however, it’s possible because both are existing that they’re not networked together, correct?

    So my questions would then be…

    Does the subsite have have to have no WordPress installation, in order for it to be added as a subsite under the main parent site (that’s installed as a network site)? If WordPress is already installed on the subsite, does that mean there will be trouble getting it added as a subsite to the parent?

    I think this may answer my questions:

    https://www.youtube.com/watch?v=Y9wFjHcowk4

    • This reply was modified 4 years, 4 months ago by haltek18.
    • This reply was modified 4 years ago by Jan Dembowski.
    Thread Starter haltek18

    (@haltek18)

    Thank you. I use Bluehost.

    To answer you questions:

    They told me that my server uses Ningix under Apache.
    They told me that they can clear my RAM and website cache or I can do that through SSH.
    They allow me to disable my CDN if needed.

    Thread Starter haltek18

    (@haltek18)

    Thanks @maxgx.

    I added your script to my child theme’s function.php file, however, wasn’t able to get it to work. Since I’m not a programmer, I’m not sure why it’s not working, but I’m working with a few programmers to help get it to successfully work.

    I’d be interested to see a screenshot of how it’s working with your theme (the button underneath the thumbnail, you said). Is there any special configuration you had to do with the Favorites plugin itself in the backend, and are you using the default Gallery that WP generates?

    Wish someone or the original author, Kyle Phillips, would release a modified/forked/updated Favorites plugin so we can get the favorite image functionality to work natively! I’m sure a lot of people would like to have this kind of functionality.

    • This reply was modified 4 years, 8 months ago by haltek18.
    Thread Starter haltek18

    (@haltek18)

    @maxgx and @nemessis, I tried the code that was given in this topic: https://wordpress.org/support/topic/favorite-single-images-or-in-gallery/ but I can’t get the favorites button on each thumbnail after putting the code in my functions.php file. How did you put the images on your page to get the favorites button to appear there? Does this code still work? Does this code vary by theme? Do I need to configure the current Favorites plugin to get this work properly? Do I need to look at my media.php file for changes? Let me know. The other topic is closed.

    Thread Starter haltek18

    (@haltek18)

    Also the ability to link to the post type, but not sure how to accomplish it. Please help.

    Thread Starter haltek18

    (@haltek18)

    Nevermind. I found out that my CDN was blocking my website with that script. It’s all resolved now.

    Thread Starter haltek18

    (@haltek18)

    For example: http://www.blenkerco.com/robots.txt shows something completely different from blenkerco.com/robots.txt

Viewing 15 replies - 1 through 15 (of 16 total)