Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #1291  
Old 09 Dec 2010, 13:06
ghostpt ghostpt is offline
 
Join Date: Oct 2007
Question Change page title dynamically

Hi everyone.

The page title is set on the template,


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

... is there way to set title dynamically within the custom php file?

Thanks in advance.
Reply With Quote
  #1292  
Old 09 Dec 2010, 15:06
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
If you make a variable on the .php file like $customtitle, then put <title>$customtitle</title> in the template that *should* work. I'd try it at least.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #1293  
Old 09 Dec 2010, 17:29
ghostpt ghostpt is offline
 
Join Date: Oct 2007
Originally Posted by BirdOPrey5 View Post
If you make a variable on the .php file like $customtitle, then put <title>$customtitle</title> in the template that *should* work. I'd try it at least.

Thanks BirdOPrey5, I'll give it a try!

Edit: Worked like a charm, thanks!

Last edited by ghostpt; 09 Dec 2010 at 17:35.
Reply With Quote
  #1294  
Old 13 Dec 2010, 12:24
ni_hao ni_hao is offline
 
Join Date: Nov 2006
Thanks for the tutorial, works perfect!
Reply With Quote
  #1295  
Old 17 Dec 2010, 05:28
just.b.jealous just.b.jealous is offline
 
Join Date: Sep 2009
I need some help guys, I've got my page working for the most part. I just need to know how to make it parse BBCode that's being pulled from vBulletins threads.
Reply With Quote
  #1296  
Old 17 Dec 2010, 05:37
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Originally Posted by just.b.jealous View Post
I need some help guys, I've got my page working for the most part. I just need to know how to make it parse BBCode that's being pulled from vBulletins threads.
You need to initialize and use the BB Code parser...
In the php file near the top add the lines:


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

Then you can use this line (change the $rawthread and $parsedthread variables to your needs) to get the parsed output (BB Code converted to HTML)


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

The "true" on the end is to parse smilies too... if you don't want smilies make it "false".
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #1297  
Old 19 Dec 2010, 22:15
just.b.jealous just.b.jealous is offline
 
Join Date: Sep 2009
Originally Posted by BirdOPrey5 View Post
You need to initialize and use the BB Code parser...
In the php file near the top add the lines:


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

Then you can use this line (change the $rawthread and $parsedthread variables to your needs) to get the parsed output (BB Code converted to HTML)


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

The "true" on the end is to parse smilies too... if you don't want smilies make it "false".
awesome, thanks for helping me out,.. I'm a little stuck at the moment though,.. could you take a look at my test.php page for me- it's still not parsing BBCode,..


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

Using:

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

Gives me this error:
Warning: require_once(DIR/includes/class_bbcode.php) [function.require-once]: failed to open stream: No such file or directory in /forum/test.php on line 4
Fatal error: require_once() [function.require]: Failed opening required 'DIR/includes/class_bbcode.php' (include_path='.:/usr/local/php5/lib/php') in /forum/test.php on line 4
Using:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Gives me this error:
Fatal error: Class 'vBulletinHook' not found in /forum/includes/class_bbcode.php on line 2463
I'm also a little confused on what to do with:
Then you can use this line (change the $rawthread and $parsedthread variables to your needs) to get the parsed output (BB Code converted to HTML)

Last edited by just.b.jealous; 19 Dec 2010 at 23:05.
Reply With Quote
  #1298  
Old 20 Dec 2010, 01:31
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
It looks like the errors are because you need the require_once ('./global.php') file above everything else basically... in your script directly under the "error reporting" line near the top. Also if this php file is in the same directory as your forum root (where global.php is located) you don't need the ./ just use require_once ('global.php');

I'm also a little confused on what to do with:
Then you can use this line (change the $rawthread and $parsedthread variables to your needs) to get the parsed output (BB Code converted to HTML)
What variable stores the text you need to have parsed? I'm calling it $rawthread in my code... and the output of the BB Code Parsing function, the "translated" text if you will, I'm calling $parsedthread. You can use any names you want but whatever you call $parsedthread is going to be the data you want to output to the browser.

--------------- Added 20 Dec 2010 at 01:36 ---------------

Looking over your code you seem to be missing any data to parse... You don't parse a template usually, a template should have real HTML not BB Code. Usually text like posts and signatures would be the only things requiring parsing.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.

Last edited by BirdOPrey5; 20 Dec 2010 at 01:36. Reason: Auto-Merged DoublePost
Reply With Quote
  #1299  
Old 20 Dec 2010, 20:18
just.b.jealous just.b.jealous is offline
 
Join Date: Sep 2009
Well I'm making some progress at least,.. you've got it working- which I owe you millions of thanks for, but I'm having an issue of it parsing a little to much onto the page.

I'll break down what I'm trying to accomplish.

The test.php page calls a new template called test,.
The test template calls a plugin named $homepage_recent_post,..
$homepage_recent_post displays:
7 recent threads from specific subforums,
Display the thread title,
Display the date posted,
Display who posted it,
Display the pagetext, (the post itself),
Display a link to that thread.

If I setup my test.php page like:

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


With this plugin:

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


I'll get the 7 last post, but they're unparsed.

Now if I setup my test.php like:

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


and with the same $homepage_recent_post plugin, it'll parse the plugin- pagetext
and all, but then it's parsing too much onto my page. Here's an example of the same post from above, but parsed.

Is there any way to parse just post.pagetext onto this page instead of parsing the entire plugin? If so, how do I go about doing it?

Last edited by just.b.jealous; 23 Dec 2010 at 04:02.
Reply With Quote
  #1300  
Old 20 Dec 2010, 21:21
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
The BB Code parsing needs to be done in your plugin not the .php file...

Using the 1st version you posted in the above post make the plugin into:


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

Don't forget to put the:

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

At the top of the plugin now... and you may need global.php too, try it and see.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #1301  
Old 20 Dec 2010, 21:37
just.b.jealous just.b.jealous is offline
 
Join Date: Sep 2009
awesome bro, I'll go check it out right now, thanks for lending me a hand.

--------------- Added 20 Dec 2010 at 22:04 ---------------

Almost got it, we're most definitely closer..



It parses the post correctly but parsed the [img] into a clickable link instead of showing the picture. Any ideas? Using your suggestion results like this with or without requiring global at the top of the plugin, I also made the test.php with requiring the bbcode_parser, or the parsing line that it had previously.... I'm stumped..

--------------- Added 20 Dec 2010 at 22:29 ---------------

I just noticed something else, the plugin results in 14 results instead of 7, it displays the first 7 threads from the forum and displays each of them twice.

Last edited by just.b.jealous; 23 Dec 2010 at 04:02. Reason: Auto-Merged DoublePost
Reply With Quote
  #1302  
Old 23 Dec 2010, 00:24
just.b.jealous just.b.jealous is offline
 
Join Date: Sep 2009
I have fixed it where it shows the posts twice, but for some reason I cannot get it to parse the images from the post. Any ideas?
Reply With Quote
  #1303  
Old 23 Dec 2010, 01:22
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Yeah forgot they don't parse images when using 'nonforum'- replace that with a valid forum id of one of your forums where images are allowed...

Basically try something like...


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

Info on bbcode parsing: http://members.vbulletin.com/api/vBu...odeParser.html
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #1304  
Old 23 Dec 2010, 03:59
just.b.jealous just.b.jealous is offline
 
Join Date: Sep 2009
Worked like a charm- I'm good to go. Thanks for helping me out soo much- I appreciate it. Happy Holidays!!
Reply With Quote
  #1305  
Old 23 Dec 2010, 04:11
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Glad to help. Happy Holidays.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
Reply



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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 18:31.

Layout Options | Width: Wide Color: