Problems, need help? Have a tip or advice? Post it here.
70 posts Page 4 of 7
Previous 1, 2, 3, 4, 5, 6, 7 Next
@Bartonsweb, I tried your idea. No luck. I also tried
Code: Select all
<cms:pages>
   <cms:if k_publish_date="0000-00-00 00:00:00">
      <cms:show k_page_title/>
   </cms:if>
</cms:pages>

No good. That leads me to believe that unpublished pages are pre-filtered by the cms before the pages tag ever sees them, suggesting that it is not possible to show unpublished pages on the front end.
This RESULT in nothing! The unpublished pages dont show!

I did try:

<cms:pages masterpage='users/ferie-add.php' show_future_entries='1' start_on to="0000-00-00">
<cms:pages masterpage='users/ferie-add.php' show_future_entries='1' start_on="0000-00-00">
<cms:pages masterpage='users/ferie-add.php' show_future_entries='1' start_on to="0000-00-00" stop_before to="0001-00-00">
Then I am not sure it is possible at all, maybe a better man than me can try!

Sorry
Image
The cms:pages tag won't be helpful in this case, I'm afraid.

You can try using explicit SQL statements via the <cms:query> tag as follows -
Code: Select all
<cms:set my_sql="
    SELECT p.id, p.template_id
    FROM <cms:php>echo K_TBL_PAGES;</cms:php> p
    inner join <cms:php>echo K_TBL_TEMPLATES;</cms:php> t
    on p.template_id = t.id
    WHERE t.name='blog.php'
    AND parent_id = '0'
    AND publish_date = '0000-00-00 00:00:00'
    ORDER BY publish_date desc;
" />

<cms:query sql=my_sql limit='10' paginate='1' fetch_pages='1'>
    <!-- variables from the pages fetched available here exactly like in cms:pages -->
    <a href="<cms:show k_page_link />"><cms:show k_page_title /></a><br />
</cms:query>

Hope it helps.
Dynamic Folders !

When making folders you get a dropdown when edit user! But is there possible to get 2 dropdowns?

I wanna make the user be attached to 2 main folders!

If i have 1 folder - States with child folders like New York, California etc. And second folder is Categories with child like Wood Worker, Steal Worker, Car Seller etc.

And i need to be able to make the user be attached to 1 state and 1 categori!

Or do i have to use RELATIONS for this?
There can be only one set of folders.
For a second type of categorization, we can use relations.

BTW, you did not let us know if the solution for listing only unpublished pages (viewtopic.php?p=23534#p23534) worked for you.
KK wrote: The cms:pages tag won't be helpful in this case, I'm afraid.

You can try using explicit SQL statements via the <cms:query> tag as follows -
Code: Select all
<cms:set my_sql="
    SELECT p.id, p.template_id
    FROM <cms:php>echo K_TBL_PAGES;</cms:php> p
    inner join <cms:php>echo K_TBL_TEMPLATES;</cms:php> t
    on p.template_id = t.id
    WHERE t.name='blog.php'
    AND parent_id = '0'
    AND publish_date = '0000-00-00 00:00:00'
    ORDER BY publish_date desc;
" />

<cms:query sql=my_sql limit='10' paginate='1' fetch_pages='1'>
    <!-- variables from the pages fetched available here exactly like in cms:pages -->
    <a href="<cms:show k_page_link />"><cms:show k_page_title /></a><br />
</cms:query>

Hope it helps.


Thanks KK, your the best. Works perfectly :)
So i have a new question regarding CLASSIFIED ADS page i made with alot of user.

How can i make it so the user can ad ads on the front end and the ads will then belong to the user.

So if im a Car Dealer and im having a account at www.kahu.no! I log in and find a form ADD NEW AD and when posting this ad the ad becomes a new page but belongs to the CAR DEALER and will only show at the CAR DEALERS page in view or list mode!

Today i use relation many-to-one but this is no good soultion because the user see all the users and must select his user and so the ad gets saved as a relation to that user.

Hoping someone have any good idea about this. I beleve i can do something like when the user EDIT his profile and uses the GET id function or something but im a bit stuck and cant make it work!
Do you already have login system for the user?
Today i use relation many-to-one but this is no good soultion because the user see all the users and must select his user and so the ad gets saved as a relation to that user.

You don't have to give a choice (i.e. show the dropdown) to the user as it is predetermined that the ad would be related to the logged-in user.

You can explicitly set that value directly within the <cms:db_persist_form> tag as follows -
<cms:db_persist_form
_invalidate_cache='0'
_auto_title='1'

ad_owner = k_user_id
/>

The code above assumes that the many-to-one region is named 'ad_owner' and k_user_id contains the ID of the logged-in user. Change them to suit your specific case.
Previous 1, 2, 3, 4, 5, 6, 7 Next
70 posts Page 4 of 7