Forum Replies Created
-
AuthorPosts
-
Byron Dokimakis
ParticipantNeat. Problem solved. Did i thank you for the fast response? 🙂
Byron Dokimakis
ParticipantI was trying to avoid that solution, it’s too brute force for me 😛
Could you point me to the point where the current blog should be selected (if no blog is selected in multisite settings), so i can troubleshoot it a bit, and maybe make the original functionality work?
Thanks for your time!
Byron Dokimakis
ParticipantYeap, that was the reason no html was produced. However, we must be bumping on to more than a syntax problem this time.
I have created 2 search forms, each one with a different blog assigned in multisite settings. http://prntscr.com/32qi8p
However, the shortcode is using the first form i created, regardless of the site i am currently using. Is it normal that i can see all forms from all sites’ plugin settings?
Byron Dokimakis
ParticipantI must be doing it wrong.
Here is the relevant code from shortcodes.php:
<pre class=”lang:php decode:true ” >else {
global $wpdb;
if (isset($wpdb->base_prefix)) {
$_prefix = $wpdb->base_prefix;
} else {
$_prefix = $wpdb->prefix;
}
$search = $wpdb->get_results(“SELECT * FROM “.$_prefix.”ajaxsearchpro”, ARRAY_A);
if (!isset($search[0])) {
echo “This search form does not exist!”;
$return = ob_get_clean();
return $return;
}
if (isset($search[0][‘id’]) && isset($wpdreams_ajaxsearchpros[$search[0][‘id’]])) {
echo “This search form is already on the page! You cannot use the same form twice on one page!”;
$return = ob_get_clean();
return $return;
}
$wpdreams_ajaxsearchpros[$search[0][‘id’]] = 1;$id = $search[0][‘id’];
$search[0][‘data’] = json_decode($search[0][‘data’], true);
$style = $search[0][‘data’];
}And here is my shortcode:
<pre class=”lang:default decode:true ” ><?php echo do_shortcode(‘[wpdreams_ajaxsearchpro_results id=0 element="div"]‘); ?>And here are my forms:
http://prntscr.com/32qha1
http://prntscr.com/32qhbjAnd here is the problem:
http://prntscr.com/32qhdzThe shortcode does not produce any output.
Any ideas?
-
This reply was modified 12 years, 2 months ago by
Byron Dokimakis. Reason: tried to fix code tags (?)
Byron Dokimakis
ParticipantWell, that was a smart workaround. Thanks a lot! (i think it would be great if the original functionality would also work – so as to avoid workarounds)
Byron Dokimakis
ParticipantThat would mean that i cannot have one search form for all sites, and thus cannot insert it in a template file, because each site will have a different form id, correct?
Byron Dokimakis
ParticipantI can see all the sites that have the public attribute enabled. However, if i select one of them, what about the other sites’ results? I want each site to show its own results.
Basically, the problem is that “If you not choose any site, then the currently active blog will be used!” doesn’t seem to be working.
-
This reply was modified 12 years, 2 months ago by
Byron Dokimakis.
-
This reply was modified 12 years, 2 months ago by
-
AuthorPosts