Guests can add news

Download plugins, language packs and stuff.

Postby alien13 » Sat May 12, 2007 9:23 pm

FI-DD wrote:
2.This mod has another problem that once before I asked about but no response recieved. That is : when guest post an article without filling the "required xfields", it says that you have not filled all required fileds and should go back and send again. However, when you sign in as admin you will find all guest posts( including that one rejected before), added to database and waiting for approval?!

regards


You have to add the XFields to the javascript check. By default it only checks if the short-story is blank:

Code: Select all
if (document.guest.short_story.value == ""){

     document.guest.short_story.focus();

     alert ("The short story can't be blank.");

     return false;

   }




Copy this code and replace "short_story" with the name(s) of your XField(s).




So, I have the same problem and I try to copy the javascript check with the name of the xfiled, but is the same. It show "You should fill in all required fields." and the post from users (including that one rejected before) are added to database waiting for approval.



For example I have xfield with name - source.



I try with



Code: Select all
if (document.guest.source.value == ""){

     document.guest.source.focus();

     alert ("The short story can't be blank.");

     return false;




Nothing hapend.



Then I try with:



Code: Select all
if (document.guest.xfield[source].value == ""){

     document.guest.xfield[source].focus();

     alert ("The short story can't be blank.");

     return false;




And again, nothing hapened.



Please, I need help :roll:
alien13
 
Posts: 20
Joined: Fri Apr 13, 2007 5:48 pm

Postby FI-DD » Mon May 14, 2007 8:32 pm

If you change

Code: Select all
<input type="text" name="xfield[$fieldname]" id="xfield[$fieldname]" value="$fieldvalue">




to

Code: Select all
<input type="text" name="xfield[$fieldname]" id="xfield_$fieldname" value="$fieldvalue">




in plugins/xfields/core.php then this works:

Code: Select all
if (document.guest.xfield_source.value == ""){

     document.guest.xfield_source.focus();

     alert ("The short story can't be blank.");

     return false;




I didn't test if this breaks the other XFields functions.
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby astrostart » Mon Jun 25, 2007 10:59 am

I also have a suggestion!

I want users to use it as a forum, so I don't want to show all categories (because then they can post is as news).

So how can i show only a few categories (which I can choose myself). If that don't work: how can I transform the code so the news will be posted in one automatic category (for instance: 31)
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
User avatar
astrostart
 
Posts: 124
Joined: Sun Feb 11, 2007 6:08 pm
Location: The Netherlands

Postby scottdallas » Mon Jun 25, 2007 4:55 pm

You can set which categories display at the top of the guest.php file.. If it is too limited to only be able to set one certain amount of categories.. perhaps make different 'guest can add news' files with different categories defined?
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby riri » Tue Nov 13, 2007 12:35 am

Hello, thanks for the tip but when I put the author's name, it shows not on the site, how can I solve this problem please?

Thanks
riri
 
Posts: 51
Joined: Tue Aug 21, 2007 8:32 pm

Postby Partyism » Wed Nov 14, 2007 11:58 am

submit.php

<?
include $cutepath.'/guest.php';
?>


Fatal error: Cannot redeclare cqt_macros_variables() (previously declared in
/artikelen/plugins/custom-quick-tags.php:25) in /
/artikelen/plugins/custom-quick-tags.php on line 25

It wil show when i go to guest.php
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby scottdallas » Fri Nov 16, 2007 7:44 am

Hey not to change subject... but I thought this hack would be cool with email notification with at least a link to the article in the email.
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby FI-DD » Fri Nov 16, 2007 11:04 am

scottdallas wrote:Hey not to change subject... but I thought this hack would be cool with email notification with at least a link to the article in the email.

Look at this:
http://english.cutenews.ru/forum/guests ... .html#6105

and at this:
http://english.cutenews.ru/forum/guests ... .html#2937

Combine them both and you should get what you want.
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby FI-DD » Fri Nov 16, 2007 11:05 am

Partyism wrote:Fatal error: Cannot redeclare cqt_macros_variables() (previously declared in
/artikelen/plugins/custom-quick-tags.php:25) in /
/artikelen/plugins/custom-quick-tags.php on line 25

It wil show when i go to guest.php

Remove "include('head.php');" from guest.php.
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby Partyism » Fri Nov 16, 2007 1:23 pm

Many Thnx FI-DD.

edit: got captcha working after all, :D
edit2: however, no matter what. The submitted news wil always be posted with or without approval or hidden=1 in phpmyadmin :s
Somebody solved this already?!
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby scottdallas » Fri Nov 16, 2007 11:30 pm

Thanks FI-DD sorry for overlooking the obvious :oops:

Hey.. now you know what my next question will be right lol..

How do I put <a href="'.cute_get_link($link).'">Click here to view your post.</a> in the simple mail code mail("mail@mail.com", "New guest news", "There's a new guest news", "From:mail@mail.com");
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby RDM » Sun Nov 18, 2007 12:05 am

Ok now, this works great. But I found a bug:

If two or more guests enter the same title, when you will see the news in full story, you will see all of them with the same title.
RDM
 
Posts: 40
Joined: Fri Jan 12, 2007 9:07 pm

Postby Partyism » Thu Nov 22, 2007 9:52 am

Another thing that doesnt work is the {author} function. It wont show who the author is but in the admin it does
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby FI-DD » Thu Nov 22, 2007 6:34 pm

scottdallas wrote:How do I put <a href="'.cute_get_link($link).'">Click here to view your post.</a> in the simple mail code mail("mail@mail.com", "New guest news", "There's a new guest news", "From:mail@mail.com");


Code: Select all
$link = reset($sql->select(array('table' => 'news', 'where' => array("id = ".$id))));
$my_message = "There's a new guest news\n\n";
$my_message .= '<a href="'.cute_get_link($link).'">Click here to view the post.</a>';
mail("mail@mail.com", "New guest news", $my_message, "From:mail@mail.com");
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby FI-DD » Thu Nov 22, 2007 6:40 pm

Partyism wrote:Another thing that doesnt work is the {author} function. It wont show who the author is but in the admin it does

In inc/show.news.php change this:
Code: Select all
$output = str_replace('{author}', $user_name[$row['author']], $output);


to this:
Code: Select all
$output = str_replace('{author}', (isset($user_name[$row['author']]) ? $user_name[$row['author']] : $row['author']) , $output);
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

PreviousNext

Return to Additional Downloads



Who is online

Users browsing this forum: No registered users and 0 guests