Problems, need help? Have a tip or advice? Post it here.
18 posts Page 1 of 2
Dear KK Sir, Cheesypoof Sir and Other Couchies,

I am working on site, that has the following structure:

siteFlow.png
siteFlow.png (28.37 KiB) Viewed 2506 times


Following is my site code.

index.zip
(291.94 KiB) Downloaded 425 times


Also, I wanted to know if we can have the CouchCMS Admin Panel display in the following manner:

listclonable.png
listclonable.png (39 KiB) Viewed 2506 times


As seen, in attachment listclonable.png, there are two areas in RED Edged Boxes.
(1) IsActive | Date From | Date To
(2) Save Selected

Ref (1): Admin should be able to set the video IsActive as "Yes or No" and specify the Date From and Date To.

Ref (2): Once the IsActive is Selected for One or More Videos, Can we save the selection? or better, Once the Date To is crossed, can the IsActive status be changed automatically?

IsActive: This works like the Events in the calender. In place of time I require to put the Date.

Please advice. I am online throughout. Any Urgent help will be more than just appreciated.
Image
where innovation meets technology
@KK Sir, @Cheesypoof Sir

I am still having problems with search. Please guide me a little on the same!!!

I made a clonable template of the video.php file that i have attached in the previous post. It has the:
1. Title Field (Default)
2. Name Field (Default)
3. Upload Video Option
4. Video Description Option

I am now stuck on:
1. Searching
2. IsActive Stuff

Awaiting your response(s)...
Image
where innovation meets technology
Hi genxcoders,

2. IsActive Stuff

The listing part can be done easily using custom-admin screens but the editing that you wish to incorporate as well will complicate stuff. So the answer - can be done but will take effort. Better skip this.

1. Searching

Well this seems quite straightforward. I suggest, for ease, you use a separate template named 'search.php' to display the search results. The documentation (http://www.couchcms.com/docs/concepts/using-search.html) explains pretty much the same approach. So what exactly you are stuck with? Please let us know.

Thanks.
Dear KK Sir,

The listing part can be done easily using custom-admin screens but the editing that you wish to incorporate as well will complicate stuff. So the answer - can be done but will take effort. Better skip this.


Actually what I wanted to achieve is, the videos should be available for view for a specified time duration. For example, a video is available to view for 12hrs, another for 2days/48hrs, etc. The site admin should be able to specify this duration. Once the duration is over, the video should not appear in search. i.e. search should return only the videos that have some view time left. How can this be done?

Sir, the site is to have two webpages, viz.:
1. Index/Home webpage: Containing the search option
2. Video playing webpage: Containing the view video option, video title and video description.

Sir my problem with using the search is that i am unable to understand where to put what. I read the link you have provided. Have used the <cms:search_form> on my index.php; and made the search.php too. I know i am wrong in placing the stuff, but the problem is i cant figure out where. I am attaching the source for your review.

index.zip
(175.98 KiB) Downloaded 419 times


Awaiting help!!! :roll:
Image
where innovation meets technology
my problem with using the search is that i am unable to understand where to put what.
Your index.php has the form that begins the search and search.php is the template that should list the search results. To make the form on index.php lead to search.php upon submission, set its 'action' parameter to search.php as follows -
Code: Select all
<form id="k_search_form" method="get" action="<cms:link 'search.php' />" accept-charset="utf-8">

Once the duration is over, the video should not appear in search. i.e. search should return only the videos that have some view time left.
That is a tricky one. The cms:search tag has no notion about the additional constrains you wish to put in.
It'll require modifying the SQL query the search tag issues by default (read - advanced stuff).

First please go ahead and see if the default search is working as expected.
We'll tackle the SQL affair once other things are in place.
Coming to think about it, your search for videos is only going to search the 'desc' editable region, right?

If that is the case, instead of cms:search, try using cms:pages tag (using the 'custom_field'). This would be a very simplified version of viewtopic.php?f=8&t=7620 as we have only one field to search.

With this method we can add the date/time interval constrain you have.

What do you think?
Sir i made the correction in the "action" attribute, as below:

<form id="k_search_form" method="get" action="<cms:link 'search.php' />" accept-charset="utf-8">
<div class="grid grid-pad">
<div class="col-9-12">
<div class="content">
<p>
<center>
<input type="text" class="search_field" name="s" id="s" placeholder="<cms:editable name='default_search_text' label='Search Box - Default Text' type='text' >Search Video</cms:editable>" onfocus="if (document.forms['k_search_form'].s.value === '') document.forms['k_search_form'].s.value=''" onblur="if (document.forms['k_search_form'].s.value == '') document.forms['k_search_form'].s.value=''" />
</center>
</p>
</div>
</div>
<div class="col-3-12">
<div class="content">
<p>
<center>
<input type="submit" class="search_button" value="<cms:editable name='search_button_text' label='Search Button - Default Text' type='text'>Search</cms:editable>" />
<input type="hidden" name="nc" value="1" />
</center>
</p>
</div>
</div>
</div>
</form>


but when i perform the search, the page comes up blank... though the url changes to "?s=two&nc=1"
Image
where innovation meets technology
Does the URL also change to 'search.php'?
If so, the cms:search tag in there is not finding any records and hence the blank page.

Add the following to *within* the search tag block to cater to this condition -
Code: Select all
<cms:no_results>
      <h3>No videos found</h3>
</cms:no_results>
1. No sir the url is not showing search.php

2. is there something wrong with my search coding? Coz, i have a feeling that the search in search.php is not searching anything in the first place and also, the index.php is unable to connect with it.

My code for search.php is:


Code: Select all
<cms:search masterpage='video.php' limit='2' keywords="<cms:gpc 's' />">
       <h3><a href="<cms:show k_page_link/>"><cms:show k_page_title /></a></h3>
       <cms:show desc />
       <p></p>
       
        <cms:if k_paginated_top >
        <div>
            <cms:if k_paginator_required >
                Page <cms:show k_current_page /> of <cms:show k_total_pages /><br>
            </cms:if>
            <cms:show k_total_records /> Pages Found -
            displaying: <cms:show k_record_from />-<cms:show k_record_to />
        </div>
       </cms:if>

       <cms:paginator />
   </cms:search>
Image
where innovation meets technology
Also, the code:

Code: Select all
<cms:no_results>
      <h3>No videos found</h3>
</cms:no_results>


doesnot return anything :oops:
Image
where innovation meets technology
18 posts Page 1 of 2