41
3lr0n
Re: data from custom user fields on forums
  • 2009/5/15 5:55

  • 3lr0n

  • Not too shy to talk

  • Posts: 167

  • Since: 2004/3/13


Hi Trabis,

but this code show the field of the lgged user isnt it?

I need to show some user fields to everybody of every user in the posts.. I mean like the field from in the left column of the forums, Behind the avatar there is the location, that is show to all visitors.. thats what i need but with some custom fields

thks
Spanish Overclocking Community xoops based site : www.overclocking.es



42
3lr0n
Re: data from custom user fields on forums
  • 2009/5/14 21:11

  • 3lr0n

  • Not too shy to talk

  • Posts: 167

  • Since: 2004/3/13


Hi,

thats it. I need to add some custom profile fields (not all of them) to some smarty vbles.

The "problem" I guess, as you said, the newbb use member handler, not the profile module. My first idea was add some data retreaving in the same part the usual fields are got (from, etc...), but as the profile handler is not created I cant.

Thks in advance!
Spanish Overclocking Community xoops based site : www.overclocking.es



43
3lr0n
Re: data from custom user fields on forums
  • 2009/5/13 21:19

  • 3lr0n

  • Not too shy to talk

  • Posts: 167

  • Since: 2004/3/13


Sry, I think must made a mistake in my explain.

I need to show to all users that are looking the forums some fields of each posting users. I mean, for example, you mboyden have a field in the db that is the location, for you Austin . I need to show in the post some poster information that is stored in profile custom fields.

I dont care is the person who is searching my website is a logged user or not, the info must be avaible to all visitors, like the "from" field of your profile is.

Do you understand me now?

I feel really sry for this mistake, all of you are putting a lot of effort on help me, and Iam really grateful

Spanish Overclocking Community xoops based site : www.overclocking.es



44
3lr0n
Re: data from custom user fields on forums
  • 2009/5/13 12:45

  • 3lr0n

  • Not too shy to talk

  • Posts: 167

  • Since: 2004/3/13


Hmmz, dont work :(

Wouldnt be easy to set it as a function on functions.php and call it from the php file that construct the post structure?, the you you can assing it to a smarty vble and print it like <{$data}>,

but i dont know how to set it :(

any help?

Spanish Overclocking Community xoops based site : www.overclocking.es



45
3lr0n
Re: data from custom user fields on forums
  • 2009/5/7 6:49

  • 3lr0n

  • Not too shy to talk

  • Posts: 167

  • Since: 2004/3/13


something?..

sty but dont understand this :(
Spanish Overclocking Community xoops based site : www.overclocking.es



46
3lr0n
Re: data from custom user fields on forums
  • 2009/5/5 22:23

  • 3lr0n

  • Not too shy to talk

  • Posts: 167

  • Since: 2004/3/13


any help?
Spanish Overclocking Community xoops based site : www.overclocking.es



47
3lr0n
Re: data from custom user fields on forums
  • 2009/5/3 19:07

  • 3lr0n

  • Not too shy to talk

  • Posts: 167

  • Since: 2004/3/13


bump!
Spanish Overclocking Community xoops based site : www.overclocking.es



48
3lr0n
Re: data from custom user fields on forums
  • 2009/4/30 19:44

  • 3lr0n

  • Not too shy to talk

  • Posts: 167

  • Since: 2004/3/13


I tried this code inside newbb_tread.html (overriding default template in themes/modules/newbb folder)

<{php}>
  
$profile_handler xoops_getmodulehandler('profile''profile');
$profile $profile_handler->get($GLOBALS['xoopsUser']->getVar('uid'));
$from $profile->getVar('user_from');
<{/
php}>
 <{
$from}>


No error, but seems to have a $from vble without value (nothing is printed on the screen).

I have to say that in the template there is already a smarty variable that could be used for gather the post authot user id, is $topic_post.poster.uid.

Any other idea to make this work?

thks
Spanish Overclocking Community xoops based site : www.overclocking.es



49
3lr0n
Re: data from custom user fields on forums
  • 2009/4/29 20:22

  • 3lr0n

  • Not too shy to talk

  • Posts: 167

  • Since: 2004/3/13


I tried it 2 ways,


<{php}>
if (is_object( $xoopsUser )) {
$GLOBALS['xoopsTpl']->assign('myField', $xoopsUser->getVar('user_from'));
}
<{/php}>

<{$myField}>

This doesnt work either, because I guess xoopsUser is not created as an object there, so it fails..

Any other option to do it?

Spanish Overclocking Community xoops based site : www.overclocking.es



50
3lr0n
Re: data from custom user fields on forums
  • 2009/4/29 20:17

  • 3lr0n

  • Not too shy to talk

  • Posts: 167

  • Since: 2004/3/13


This

$profile = $profile_handler->get($xoopsUser->getVar('uid'));

give me a

Fatal error: Call to a member function on a non-object

when i set it in the template inside php tags

Spanish Overclocking Community xoops based site : www.overclocking.es




TopTop
« 1 2 3 4 (5) 6 7 8 ... 15 »



Login

Who's Online

235 user(s) are online (149 user(s) are browsing Support Forums)


Members: 0


Guests: 235


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits