Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hi Guys.!

Its me again with another question :oops:

Im in process to make a news website (Citizen Journalism) that people can register and submit news.

So, i create (off course..,) a clonable page called "news.php", and the databound page for user submit the news, called "user/submit-news.php". Everythings goin fine for the "user/submit-news.php", a registered user can submit his news. But, how to catch who submit the news? For news.php i already try this :

[1] viewtopic.php?p=13433#p13433

and this :

[2] viewtopic.php?f=4&t=7987&p=13554&hilit=blog+author#p13554

But, i hit a problem.
For the point [1], when the user submit a news from frontend via databound, i dunno how to get the loged in user, so i need to manually choose the user from the couch backend, also i dunno whos the submiter. For this, i can fetch the user information via <cms:related_pages>.

For point [2], this way can fetch the user who loged in on the admin panel, i dunno how to get who submit the news via frontend. Also, if i log in on the backend with another account, it will change to currrently loged in account.

So, is there any way to catch the user who submit the news via frontend, and display the user info on the news page view? like avatar, phone number, address etc?


The next question about htaccess url rewrite.
This is my folder structure :
Code: Select all
-root

--couch

--user
---index.php
---submit-news.php
---login.php
---register.php
---lost-pwd.php
---edit-profile.php

--news.php
--index.php


so the url for user :
Code: Select all
http://mysite.com/user/user-name.html


is there any htaccess tweak (is it possible) to make the url become like this :
Code: Select all
http://mysite.com/user-name

Just for user page view. I want the other url still same, /user/login.html, /user/register.html etc


I hope some1 can pass me some suggestions and help offcourse :D

Thx!
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
Nevermind the question about "News Author", its handled already.

But I still need help about the htaccess url rewrite :lol:
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
Hi,

Trying to use a URL like the one you specified -
Code: Select all
http://mysite.com/user-name.html
would confuse Couch up into thinking that the template is 'index.php' (as opposed to 'user/index.php' that it really is). So, if possible, actually use 'index.php' as the extended-users template and you'll automatically get the URL you wish. Else, I'm sorry I don't think it'd be possible.
KK wrote: Hi,

Trying to use a URL like the one you specified -
Code: Select all
http://mysite.com/user-name.html
would confuse Couch up into thinking that the template is 'index.php' (as opposed to 'user/index.php' that it really is). So, if possible, actually use 'index.php' as the extended-users template and you'll automatically get the URL you wish. Else, I'm sorry I don't think it'd be possible.


Thx KK!

So, lets say, my user template is "root/index.php", can i use conditional like this to show homepage? :
Code: Select all
<cms:if k_is_page>
   [show user page]
<cms:else />
   <cms:embed 'homepage.html' />
</cms:if>


If yes, how to show the user list? and if possible, how to remove the *.html behind the username?

Thx!
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
can i use conditional like this to show homepage? :
Yes, that is a perfectly valid solution.

If yes, how to show the user list?
The regular way - simply use cms:pages with 'masterpage' set to 'index.php' (your extended-user template in the revised scenario).

if possible, how to remove the *.html behind the username?
If you must do that, you can try using 'Custom routes' (viewtopic.php?f=5&t=8981).

Hope it helps.
KK wrote:
can i use conditional like this to show homepage? :
Yes, that is perfectly valid solution.

If yes, how to show the user list?
The regular way - simply use cms:pages with 'masterpage' set to 'index.php' (your extended-user template in the revised scenario).

if possible, how to remove the *.html behind the username?
If you must do that, you can try using 'Custom routes' (viewtopic.php?f=5&t=8981).

Hope it helps.

Yes KK it bery help!
Thx KK!
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
6 posts Page 1 of 1