Jump to content


These Forums Are Now Read-Only


For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Photo

How to search the videos with tags has spaces in it


  • Please log in to reply
15 replies to this topic

#1 Shashi Bandari

Shashi Bandari

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 15 October 2010 - 09:29 PM

Hi

How can i search a video matching with tags that have spaces in it.

eg: i want to search videos with this tag : ali comedy

<?php
 print tubepressGallery('mode="tag" tagValue="ali comedy" orderBy="published"  relativeDates="true" border="true" autoplay="false" loop="false" showRelated="false" views="false" resultsPerPage="12" uploaded="true" title="true" playerLocation="static"');
?>

when i use above code it is searching with two tags, i.e. it is showing the videos which has the tag as ali and comedy.

how to handle the tags which has space in it.


eg: http://www.youtube.c..._q...search=tag

thanks

#2 Gary Baldwin

Gary Baldwin

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 01 March 2011 - 01:41 PM

I think it might be tagValue='"ali comedy"'

enclose the double quotes "..."

with single quotes '.."..."..'

#3 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 01 March 2011 - 03:12 PM

I think it might be tagValue='"ali comedy"'


Exactly. So I would try this...

<?phpprint tubepressGallery('mode="tag" tagValue='"ali comedy"' orderBy="published"  relativeDates="true" border="true" autoplay="false" loop="false" showRelated="false" views="false" resultsPerPage="12" uploaded="true" title="true" playerLocation="static"');?>
Give that a shot and let us know. Thanks!

#4 Corwyn Friesen

Corwyn Friesen

    Member

  • Members
  • PipPip
  • 23 posts

Posted 17 November 2011 - 02:57 PM

I tried the above method and I keep getting the following error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /path_to_folder/index.php on line 104

Any thoughts on this...thanks!

#5 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 21 November 2011 - 08:30 PM

I tried the above method and I keep getting the following error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /path_to_folder/index.php on line 104

Any thoughts on this...thanks!


Could you copy/paste the code from index.php around line 104 to this forum? It's likely a syntax error that should be easy to spot. Thanks!

#6 Corwyn Friesen

Corwyn Friesen

    Member

  • Members
  • PipPip
  • 23 posts

Posted 21 November 2011 - 09:15 PM

You bet...as below

<?php print TubePressPro::getHtmlForShortcode('theme="mytheme" mode="tag" tagValue='"Ontario Place"' resultsPerPage="4" orderBy="published" ajaxPagination="true" paginationAbove="false" embeddedWidth="520" embeddedHeight="324" autoplay="false" length="false" showRelated="false" showInfo="true" views="false"'); ?>


#7 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 23 November 2011 - 09:32 PM

Try this instead:

<?php print TubePressPro::getHtmlForShortcode('theme="mytheme" mode="tag" tagValue=\'"Ontario Place"\' resultsPerPage="4" orderBy="published" ajaxPagination="true" paginationAbove="false" embeddedWidth="520" embeddedHeight="324" autoplay="false" length="false" showRelated="false" showInfo="true" views="false"'); ?>
You'll notice that I simply escaped the two single-quotes near "Ontario Place". Let us know. Thanks!

#8 Corwyn Friesen

Corwyn Friesen

    Member

  • Members
  • PipPip
  • 23 posts

Posted 24 November 2011 - 12:43 AM

Thanks Eric...that took care of the parsing error...but, the video results were definitely not correct...it was showing lots of unrelated videos. I did a YouTube tag search for Ontario Place and the results were very different.

Any thoughts?

#9 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 28 November 2011 - 11:01 AM

Could you share a link to your site so we could take a first-hand look? I reproduced your shortcode here locally and the results are virtually identical to what I found on youtube.com. Thanks much.

#10 Corwyn Friesen

Corwyn Friesen

    Member

  • Members
  • PipPip
  • 23 posts

Posted 28 November 2011 - 11:30 AM

Thanks Eric...I've PM'd the info to you..

#11 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 29 November 2011 - 12:36 AM

Thank you for sending me that. Turns out the culprint is the orderBy="published" attribute. Notice that if you take that out, you'll get sensible results. The results you're getting are similar but not quite identical to what you'd get on youtube.com

So, of course, my suggestion would be to omit the orderBy attribute. Think that would be a possibility?

#12 Corwyn Friesen

Corwyn Friesen

    Member

  • Members
  • PipPip
  • 23 posts

Posted 29 November 2011 - 08:22 AM

I just tried that and it actually made the results worse...I'm getting results that don't have the tags that I've specified in the code.

Any other thoughts?

#13 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 04 December 2011 - 07:31 PM

Hmm maybe then I'm not understanding the problem as I thought I did.

I used this shortcode:

[tubepress theme="dctheme" mode="tag" tagValue='"Ontario Place"' resultsPerPage="4" ajaxPagination="true"            paginationAbove="false" embeddedWidth="520" embeddedHeight="324" autoplay="false" length="false"            showRelated="false" showInfo="true" views="false"]
to produce these results: http://i.imgur.com/nsIS3.png.

So I'm probably missing something but not sure what... ?

#14 Corwyn Friesen

Corwyn Friesen

    Member

  • Members
  • PipPip
  • 23 posts

Posted 08 December 2011 - 08:45 PM

That is really strange, I'm using the exact code and my results are completely different.

http://i.imgur.com/MtTLH.jpg

#15 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 12 December 2011 - 11:05 PM

I just tried this again tonight and am getting a different set of (seemingly random) results. Stand by for updates on what I find...

#16 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 12 December 2011 - 11:27 PM

I was able to reproduce the issue if my shortcode spanned multiple lines. i.e. this did not work...

print TubePressPro::getHtmlForShortcode('theme="dctheme" mode="tag" tagValue=\'"Ontario Place"\'     resultsPerPage="4" ajaxPagination="true" paginationAbove="false" embeddedWidth="520"     embeddedHeight="324" autoplay="false" length="false" showRelated="false"     showInfo="true" views="false"');
but this did work

print TubePressPro::getHtmlForShortcode('theme="dctheme" mode="tag" tagValue=\'"Ontario Place"\' resultsPerPage="4" ajaxPagination="true" paginationAbove="false" embeddedWidth="520" embeddedHeight="324" autoplay="false" length="false" showRelated="false" showInfo="true" views="false"');
Is your shortcode spanning multiple lines?