Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 26 Feb 2010, 19:00
Amit86 Amit86 is offline
 
Join Date: Feb 2008
Real name: Amit K.
PHP Help with widgets

Hey all,
im trying to code something that will echo text and vars into a widgts, while using echo it works but it outputs at the begining of the page instead of inside th wigit it self,
could you try and assit me in altering the code so it would work?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #2  
Old 26 Feb 2010, 19:17
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
You cannot use echo in the widget. You need to assign all your output to the variable $output.
__________________
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #3  
Old 27 Feb 2010, 00:43
Amit86 Amit86 is offline
 
Join Date: Feb 2008
Real name: Amit K.
so how do i assign those to a var and still keep the things i want to disaply inside dynamic?
Reply With Quote
  #4  
Old 27 Feb 2010, 04:18
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Not sure what you mean - like this?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #5  
Old 27 Feb 2010, 10:38
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Real name: Martin
well i would if i was you 2 ways i see this done

1)
create all the var's in the widget as php then register them into a array
and instead of using the default template, i would create my own then
use that to display the var's.

2)
create all the output as lynne said, and you add each line one at a time
then in the end you assign it all to output then it displays in the default template
but it takes ALOT of repetetive codeing.

Personally i do both, but i made the WoW recruitment widget i used option 2,
i created it all in php in the widget then at the end i turned it over to $output
then it will get rendered on default template, but it requires all formatting to be
done in php before $output.

-----

Maybe you should download some widgets first and see how they are buildt..
There are several doing what your trying to achive there, just using other data
than wow online players..
__________________
My website Evisystems
2013 - I'll be leaving VB, to much of a hassle using it
follow the white rabbit, feed! your head
Reply With Quote
  #6  
Old 27 Feb 2010, 11:05
Amit86 Amit86 is offline
 
Join Date: Feb 2008
Real name: Amit K.
Thanks!
i was able to use $output and it worked perfect!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 20:20.

Layout Options | Width: Wide Color: