TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,911
  • Total Topics: 21,307
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 362
  • Total: 363
  • tino

Generic Application Form

Started by JPDeni, May 23, 2009, 11:04:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

EasyRider

#80
Hey JPDeni finally works great..!    :up: :up: :up:

But 1 question.. is there way to not change the post title with the new custom..?

I mean to leave the topic title as was it in any new review post.

And i have a block  in portal front page with recent topics (rss) , and i try  test preview post, but is not appear  the review in latest (recent) topics in front page block.

Maybe is some conflict with  the custom title (see first paragraph^^) in topic..?   :-X :-X
SMF  1.1.11 / TinyPortal v1.0 beta 4 /default theme

JPDeni

You can change the post title. Just look at the code.

In the original code, there's a line


'subject' => '[Pending] Application of ' . addslashes($_REQUEST['realname']),


Put whatever you want in there, using the field name in the place of realname and you can delete or change the text that's in there. So, if you had a field name called subject, you would use


'subject' => addslashes($_REQUEST['subject']),


I don't know anything about rss, and, since I don't know what code you're using for the recent topics, I can't tell you how to adjust it for this.

Ken.

#82
Quote from: JPDeni on September 23, 2009, 05:50:06 PM
QuoteI tried hitting refresh instead of going back to the board index and it just posted the same form again.

That's a potential problem and I'm not sure how to get around it. Probably the only thing you can do is to put something in the "thank you" part that displays after the form is submitted. And if there are duplicates, the admin will just have to delete them.

Would it be possible to make it so that the Submit button causes the page to refresh along with posting the form content? After submitting my entry I refreshed the page and it worked OK for showing the new post.

EDIT: Whoops! Seems to have posted it twice?
http://tester.jpdeni.com/index.php?topic=4.msg19#msg19
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

EasyRider

#83
JPDeni,  If i don't want change the post title..? for example  i mean to be like this title:

"Re: Generic Application Form"  and not the custom option..
SMF  1.1.11 / TinyPortal v1.0 beta 4 /default theme

JPDeni

Yeah, Ken. That's the problem. Refreshing shows the post, but also adds another post. If you go to the board index and then back to the topic, then you'll see the post without adding another one.

EasyRider, it looks like I'll have to add some more code. Hang on.

JPDeni

#85
Okay. :)

Change the first line of your code to


global $sourcedir, $ID_MEMBER, $context, $scripturl, $user_info, $db_prefix;


After


if ($enable_post) {  //create new forum post with application


Add


$topic = $_GET['topic'];
$result = db_query("SELECT m.subject
FROM {$db_prefix}messages as m, {$db_prefix}topics as t
WHERE m.ID_TOPIC = $topic
AND t.ID_FIRST_MSG = m.ID_MSG", __FILE__, __LINE__);

$row = mysql_fetch_assoc($result);
$subject = $row['subject'];
mysql_free_result($result);


and then set your subject line to


'subject' => 'Re: ' . $subject,


EasyRider

Great..!! Work..!!!   Thank you  JPDeni..!!!!
SMF  1.1.11 / TinyPortal v1.0 beta 4 /default theme

JPDeni

:) There's lots of different stuff you can do with this form. I like try new things and it's interesting to see what different things people come up with that I can figure out.

Freddy


JPDeni


This website is proudly hosted on Crocweb Cloud Website Hosting.