SOLVED - How to get a Custom Field Value in Viewforum_Body

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
Locked
renefeli2
Registered User
Posts: 3
Joined: Fri Mar 09, 2012 3:18 pm

SOLVED - How to get a Custom Field Value in Viewforum_Body

Post by renefeli2 »

Hi,
I have a bit modified my phpbb_posts table, as I have added a new field to the existing ones : "city_name".
This value is set during the posting phase with a choice list of cities name.

My question is : what and where do I have to add the code in order to be able to display this field value at any time. In fact, if I do a {FORUM_DESC} at any time and anywhere in Viewforum_body I have the right field value displayed, but I'd like to be able to do the same with my new added field "city_name" from Posts table (displayed in the Topics' title you can see from Viewforum_body) ?
Am I clear enough :oops: ?

I'm not talking about custom profile field, but a real new custom field in Posts table, and would like to use this field to display it in Viewforum_Body and Viewforum_Topic as well (as being part of the titles displayed, for showing the city name that goes with the current post)...

NB : sorry for my english, and sorry I'm begginer in coding, but I'd really like to display this field value in the topic title with the city_name please !

THANKS
Last edited by renefeli2 on Tue Mar 13, 2012 1:22 pm, edited 1 time in total.

renefeli2
Registered User
Posts: 3
Joined: Fri Mar 09, 2012 3:18 pm

Re: How to get a Custom Field Value in Viewforum_Body

Post by renefeli2 »

I was wondering if this is not too complicated to do or to set up...

An other way, or let say a work arround which also would suit my wishes would be to concatenate two fields in one.

During the posting phase, the user fill out the city_name field (from Posts table) and the post_subject field (from Forums table).
I'd like to be able to add, concatenante, join the content of city_name to post subject and have : post_subject = city_name + post_subject

I have this in Posting.php :

Code: Select all

$post_data['city_name']         = request_var('city_name', '');
$post_data['post_subject']      = utf8_normalize_nfc(request_var('subject', '', true));
It would be to reach something like that :

Code: Select all

$post_data['city_name']         = request_var('city_name', '');
$post_data['post_subject']      = utf8_normalize_nfc(request_var('subject','city_name' '', true));
I know this is not correct and doesn't work, but please could you help me solving this issue by concatenating thos both field value in one, that would match my desires finally :oops: .

Thanks

Locked