PDA

View Full Version : vB CMS Capabilities


KGodel
12-12-2014, 04:39 PM
Hey guys. First, I want to state I have read the article at this link (http://www.vbulletin.com/vbcms/content.php/151-How-To-CMS) which is commonly linked in these threads. I have some questions not covered in these articles.

First, is there any way to have threads from a forum display as the main page? Example: We have an announcement forum. I have tried playing with it but I cannot seem to find out how to link them.

Second, there is an outdated article for how to create php pages. It says there is a new php content type, but the only thing I can create are articles. Am I missing something?

Any help would be appreciated. :)

AndrewSimm
12-12-2014, 05:20 PM
You can promote an post/thread on any forum to the main page. On my site we use the CMS often and when one of the writes produces an article they write it in the appropriate forum and then promote it to the front page. This give users 2 spots to read the articles and make comments on it.

KGodel
12-12-2014, 05:48 PM
Ahh, I see that now. I think I might switch to vBA CMPS. vB CMS isn't too user friendly and lacks some basic behaviors I'd like to use. Thanks for you input Andrew.

HM666
12-13-2014, 12:48 AM
Ahh, I see that now. I think I might switch to vBA CMPS. vB CMS isn't too user friendly and lacks some basic behaviors I'd like to use. Thanks for you input Andrew.

As far as I know vBA CMPS is no longer supported. I believe that pretty much everything at vBAdvanced has gone downhill, so you may want to keep in mind that if you have a problem you will likely not be able to get support or be able to fix it if it needs to be fixed.

ozzy47
12-13-2014, 01:08 AM
Yeah their site is no longer up anymore, so it is gone. :(

HM666
12-13-2014, 01:14 AM
Yeah their site is no longer up anymore, so it is gone. :(

Oh wow really? Holy........Glad I downloaded the vBA Links I bought and got the last version they had.....

KGodel
12-13-2014, 01:30 PM
Their site is online. Its how I downloaded the mod.

ozzy47
12-13-2014, 02:45 PM
Strange, it is down in FF for me, but not IceDragon. :confused:

HM666
12-13-2014, 03:14 PM
Chris I see it in FF just fine I'm using FF 34.0.5.

There is still the issue of the site not really being manned for support though. Its something to think about. It really depends on how good you are with figuring out and fixing things in the site.

KGodel
12-13-2014, 09:34 PM
I tried out both and both have functionality I like, just not together and neither quite works how I'd like it to. More research I guess.

HM666
12-13-2014, 11:19 PM
I tried out both and both have functionality I like, just not together and neither quite works how I'd like it to. More research I guess.

Ok you have other options out there. Look into Wordpress (https://wordpress.org/) & Joomla (http://www.joomla.org/). Both are free scripts that can be installed and styled on your web host. Both do have bridges to vBulletin if you do not mind paying for them and if you need to have the ability for members to have one login on both areas. Both bridges are not too terribly costly, not more than $50 I think. Both you have more control over how you style the site. Out of the two I personally like Wordpress better. Its easier to use for someone who is first starting out or who has not used the software before. Both have tons of free plugins, modules etc to enhance your site to what you want exactly.

RichieBoy67
12-14-2014, 05:30 PM
Yeah their site is no longer up anymore, so it is gone. :(
Wow! That is terrible news.

The best thing I liked about that portal was being able to integrate into the forum so sidebars can be added to both sides of the forum.

I also like being able to see the actual posts from the forum on the portal rather than having a whole duplicate article made.

Sad to see them go after all these years!

--------------- Added 1418585490 at 1418585490 ---------------

I tried out both and both have functionality I like, just not together and neither quite works how I'd like it to. More research I guess.

Though more complex you may look into integrating Wordpress or Joomla.

AndrewSimm
12-15-2014, 02:59 AM
What are you concerns with the vbulletin CMS?

KGodel
12-15-2014, 08:20 PM
I'm trying to keep everything within the same system. We have used Joomla/Wordpress before and felt like keeping two sites updated wasn't a fit for us.

As for the CMS, it's not very straightforward. We were looking for something that's pretty easy to follow. Mostly the section/page structure, even after reading several tutorials. We'd like, for example, certain posts to appear on different "pages". News, Our Media Stuff, Newsletters, etc. I've looked for modules to do this, but my guess is I would need to make some custom modules to have this happen. I'm barely at decent plugin level let alone creating more complicated widgets.

If someone wants to help me set things up using VB CMS I'd gladly throw a bit of money your way, granted not a lot (but maybe, I'm interviewed for a developers job tomorrow!) Thanks in advance for any help!

RichieBoy67
12-15-2014, 08:26 PM
I'm trying to keep everything within the same system. We have used Joomla/Wordpress before and felt like keeping two sites updated wasn't a fit for us.

As for the CMS, it's not very straightforward. We were looking for something that's pretty easy to follow. Mostly the section/page structure, even after reading several tutorials. We'd like, for example, certain posts to appear on different "pages". News, Our Media Stuff, Newsletters, etc. I've looked for modules to do this, but my guess is I would need to make some custom modules to have this happen. I'm barely at decent plugin level let alone creating more complicated widgets.

If someone wants to help me set things up using VB CMS I'd gladly throw a bit of money your way, granted not a lot (but maybe, I'm interviewed for a developers job tomorrow!) Thanks in advance for any help!

You can do this by using sections. Check out our cms, http://musclemecca.com

HM666
12-15-2014, 10:02 PM
Yeah any time I set up a CMS I use the sections only no categories. The categories do not give you a breadcrumb link for whatever reason.

KGodel
12-15-2014, 10:08 PM
So each page needs to be its own section? Doesn't every section need a default category for articles to be placed in? Also, We'd have to promote every thread we want to show to an article, correct?

Edit: Guess not. Also, do I have to change the settings to make article comments and thread replies the same? And finally, I'm not sure if my articles are saving to the right section. I pick it from the select list, but when I open it up, nothing is chosen so I'm not sure what's up. :X

HM666
12-16-2014, 12:02 AM
So each page needs to be its own section? Doesn't every section need a default category for articles to be placed in? Also, We'd have to promote every thread we want to show to an article, correct?

Edit: Guess not. Also, do I have to change the settings to make article comments and thread replies the same? And finally, I'm not sure if my articles are saving to the right section. I pick it from the select list, but when I open it up, nothing is chosen so I'm not sure what's up. :X

Ok question one: no every page does not need to have its on section, but let's say in the case of my web site. If I were to put it on the vBulletin CMS instead of just coding a regular HTML/CSS based web site I would have the following top sections: these sections would have subsections or they could have them if wanted. So my top sections would be the home page, portfolio, services, support, FAQ'S, Free Quote & Contact. Then my subsections would be...

Home Page: Probably any news or I would have new articles show here that were posted possibly some tutorials on using vBulletin.

Portfolio: Subsections would be...Web Design, Blogs, CMS, E-Commerce, & Forums.
-----Then I would have subsections off those sections which would include Designs, Maintenance, Coding off each one of the above. So when you looked at Forums there would be subsections of Designs, Maintenance, and then Coding.

And the same for each of my top sections. Basically what I did was follow my top menu structure. you can actually see my page here: http://lenmkaiser.com its not in vBulletin but you can see the structure I'm referring to. Then you add as many or as few articles as you want to each section. Add whatever fits in there. In my case I would not add my Wordpress portfolio pages into my vBulletin section for obvious reasons.

Question two: I've used the built in vBulletin 4 CMS without using any categories whatsoever. I've found that when I created categories they really seemed irrelevant and did nothing of notable difference. I actually just finished a site for a client that had over 1000 pages & around 300-400 sections in it. No categories. It will still work just fine.

Question Three: As far as I know you do not have to change any settings. When a member makes a comment on your article it goes automatically into the thread that you promoted it from. If you just created an article and there was no thread you promoted it from all the comments go into a hidden forum area just for the CMS. That being said its been awhile since I messed with the comments in articles so there actually might be a setting you have to change in 4.2.2, but from what I remember I do not think so.

Question Four: Not sure what selection list you mean exactly, but if you are having issues seeing articles then you may need to check and see that you have given the section the proper permissions so that you and others can read the articles posted there. a lot of time the reason articles are not showing is because the permissions are not set on the section. You have to make sure all sections are published. :)

KGodel
12-16-2014, 01:00 AM
Thanks. I'll see how it works out. Not sure how exactly to setup the home page, since all sections have to be in home, so I'll have to see if I have to double-list stuff in Home and say a News category. I also need to figure out how to create articles for subsections where the main section is empty. This is easy to do in the nav manager, but not necessarily in the CMS without having a page linked to in the breadcrumbs that is empty. Thanks for your detailed response. It really helps!

HM666
12-16-2014, 01:10 AM
Thanks. I'll see how it works out. Not sure how exactly to setup the home page, since all sections have to be in home, so I'll have to see if I have to double-list stuff in Home and say a News category. Thanks for you detailed response. It really helps!

Actually you do not have to have the front page have articles duplicated if you do not want to. you can choose to only allow articles from that section by editing the front page. Just click the little pencil icon up by where it says Home Page or whatever you have changed it to. Then just make sure that you have "Content From" in the drop down choose "This Section Only" what that does is it will only draw from articles that you put in that section. So it will not take articles from say your game section and stick them into your gallery section and so on. You can also elect to allow for all the subsections. This is good when you have multiple subsections as i was describing above. But if you choose to allow for all the subsections then all the articles that have been placed in that section & its lower sections will be included on the first page of that section.

Once you get the hang of the CMS its not too terribly bad, but it is a definite learning curve to figure it out entirely.

KGodel
12-16-2014, 01:13 AM
Can you allow for multiple sections to be selected? It seems to be a single selection, but I could perhaps edit it a bit to allow for multiple sections.

Edit: I did what you said for the homepage and nothing is appearing. I had to allow for subsections but that added all subsections.

HM666
12-16-2014, 04:52 AM
Can you allow for multiple sections to be selected? It seems to be a single selection, but I could perhaps edit it a bit to allow for multiple sections.

Edit: I did what you said for the homepage and nothing is appearing. I had to allow for subsections but that added all subsections.

Make sure its published and you have permission to view it. You can publish it through the AdminCP as well as on the page itself. On the page just click the pencil icon and edit like you would edit it for anything else. In the AdminCP go to vBulletin CMS>Section Manager and publish there if you cannot see it on the page.

On the home page it will add all subsections if you allow for all subsections on there. It will add everything. What do you need on the home page exactly?

AndrewSimm
12-16-2014, 06:38 AM
The CMS has a lot of capability but you really have to play with it. On my site I have 5 sections with 4 of them showing on the home page. I have about 400 categories. When one of my staff writers writes about a group of football players they select category that corresponds to their name. My section is Football and categories is the number of the player it is about. I then have an widget with 3 tabs where users can select what sport they want to read about and on the players profile I have a stream that shows the latest news about them.

My point being is you really need to decide how you want to organize your content and how it will grow. It makes it a lot easier to set it up right at first rather than going back and change a bunch of sections and categories. HM666 answered your questions spot on but feel free to ask any more. Here is my CMS so let me know if you have any questions on how I did things. https://www.canesinsight.com

KGodel
12-17-2014, 12:49 AM
So, I guess I'll post here how I want things to be organized and go from there:

The menu I will have under the articles or home tab, whatever it becomes, will be this:

Home
Information*
>About Us
>Rules & Policies
>Staff
>Structure
>Activity Requirements
>Justice
Social
>TeamSpeak3
>Skype
>Steam
Media*
>Game Reviews
>Interviews
Newsletters
Legal*
>Privacy Policy
>Terms of Service
>Disclaimer

Items without a (>) are top level menu items. Items with a * are menus that I do not want to have corresponding pages, just be a menu item with drop-down links.

Everything is a static page except Home, Game Reviews, Interviews, and Newsletters.

Home should show clan news, game reviews, and interviews. Newsletters will have the collection of newsletters. You can guess what goes on the media pages.

So what I am left with is wondering how to make a section structure where the breadcrumbs will be accurate but where I will NOT have to make pages for the menu items I don't want pages for.

HM666
12-17-2014, 01:18 AM
So, I guess I'll post here how I want things to be organized and go from there:

The menu I will have under the articles or home tab, whatever it becomes, will be this:

Home
Information*
>About Us
>Rules & Policies
>Staff
>Structure
>Activity Requirements
>Justice
Social
>TeamSpeak3
>Skype
>Steam
Media*
>Game Reviews
>Interviews
Newsletters
Legal*
>Privacy Policy
>Terms of Service
>Disclaimer

Items without a (>) are top level menu items. Items with a * are menus that I do not want to have corresponding pages, just be a menu item with drop-down links.

Everything is a static page except Home, Game Reviews, Interviews, and Newsletters.

Home should show clan news, game reviews, and interviews. Newsletters will have the collection of newsletters. You can guess what goes on the media pages.

So what I am left with is wondering how to make a section structure where the breadcrumbs will be accurate but where I will NOT have to make pages for the menu items I don't want pages for.

The items with the * would that link be leading to a CMS article, certain forum, or a thread or where exactly would the link go? If those are just the menu then you can add menu links in the Navigation under the options. There you can add extra sub links and what have you.

You cannot pick the exact sections for the home page out of the box. Its all or nothing. That is how its setup. So in order to accomplish just having certain sections show on the front page you would need some extra coding to get that to work.

You do not have to make pages for any of them if you do not want to. Like for instance, if you just want the interviews to be shown on the interviews page you can just set that section to include the subsections and do not create a page. It will then just show all the interviews in order of when they were posted on the part for the interviews.

KGodel
12-17-2014, 02:03 AM
Yea, the * items I was going to do through the navigation manager, I just want to make sure the breadcrumbs are correct. I don't want the pages leading to an "Information" section that I don't want to have a page. My guess is that I will have to make each page a sub-section of home so that the breadcrumbs go Home >> Current Page

HM666
12-17-2014, 02:08 PM
My guess is that I will have to make each page a sub-section of home so that the breadcrumbs go Home >> Current Page

Actually that is pretty much automatic. The main section that you begin with your home page is the root section so to speak so all other sections automatically are subsections of that even if you make same level sections in the admincp. The breadcrumbs lead properly in this way. I have a screen shot of my CMS sections. I installed the default information because this is my development board. So you can clearly see that "The Front Page" is the main page and the main root section. So everything breadcrumbs from that and should be ok no matter what section you put the subsection under.

KGodel
12-17-2014, 04:19 PM
I figured out my home-page issue. There is a list of pages/articles at the bottom and I have to give each one a display order before it will appear. That's a lot of editing, but hopefully they will automatically be given display orders when I add them.

http://prntscr.com/5hx6f5

HM666
12-17-2014, 04:48 PM
Yeah you can choose which ones show in the navbar menu. The navbar menu is different from the breadcrumbs though.

KGodel
12-17-2014, 05:26 PM
I meant the bottom part, "Display Content from Sub Sections"

HM666
12-17-2014, 09:39 PM
I meant the bottom part, "Display Content from Sub Sections"

Right, I knew that! I must be going senile again lol. Yes you are correct you can choose which articles even show on which page that way. you can actually do that anywhere in the CMS on any page.

KGodel
12-18-2014, 01:23 AM
So, all sections are subsections of Home, and if I want to show News on the Home Page, I must promote articles to the HOME section, NOT the News section, so having a news section is useless yes? After that if I want to include content from other sections as well I either have to give it a manual display number in the bottom menu or create something custom to include them on the new page. I think I have that right.

HM666
12-18-2014, 02:20 AM
So, all sections are subsections of Home

Yes, correct...

and if I want to show News on the Home Page, I must promote articles to the HOME section, NOT the News section, so having a news section is useless yes?

Er no. lol You can promote the thread to an article and then select which section you want it to display in. It does not have to go on the home page if you do not want it to. When you promote an article it will open an editing page just as if you started to write the article while in the CMS by using the drop down at the top right of a page.

After that if I want to include content from other sections as well I either have to give it a manual display number in the bottom menu or create something custom to include them on the new page. I think I have that right.

Not quite sure what you mean here. If you mean including it on the home page and you do not want it to show all the article subsections on your home page, you would then have to tick the box by the article you want to display as you edit the home page and untick the ones you do not want to show there. If you want an article to display in a certain section then choose that section when you create the article and it will automatically display in that section.

KGodel
12-18-2014, 03:14 AM
I meant that by default, if I want a news item to display on the home page I need to make it in the home category, or I have to tick the box to show each item individually. I'd also have to make something custom if I wanted an additional category to show on the homepage automatically since enabling sub-sections would show ALL the sub sections

HM666
12-18-2014, 11:07 AM
Yeah I think so. Kinda tired right now, but that sounds about right. You could always just name your home page News instead of Front Page or Home if you will have several articles that land there as news articles and then you would not have to tick them they would automatically be ticked when you submitted them.

KGodel
12-18-2014, 09:27 PM
Alrighty. I think I've got it figured out. Now, does anyone have any idea on how to create and implement a plugin or something that would allow me to pull from multiple sections on one page? :D

HM666
12-19-2014, 01:49 AM
Alrighty. I think I've got it figured out. Now, does anyone have any idea on how to create and implement a plugin or something that would allow me to pull from multiple sections on one page? :D

That one is beyond my scope lol. But maybe one of the other guys will know.

Dead Eddie
12-19-2014, 02:57 AM
since all sections have to be in home

Incorrect.

All nodes (sections & content) need to be in a tree rolling up to a root node. Nothing says that you need to use that root node, though.

Out of the box, the root node is the home page for the CMS. But, there's an option to set your home page within the admincp. You can set it to any node you want.

So, you can set up the CMS to have sections that don't roll up to the home page, as long as you don't set your home page to the root node.

KGodel
12-19-2014, 03:30 AM
I get that, but wouldn't the root node still show on the breadcrumbs as the final thing, so even if I made the news section the homepage (which is the same script as the root node except with some section info in the url) I'm not quite sure it would fix the issue.

--------------- Added 1419021199 at 1419021199 ---------------

Another question. Is it possible to have a section display only 1 item? So say I have a section called "About us" and a static page. I want the About Us section link to show the page as if the section was the page instead of listing a preview like it was an article. Possible?

RichieBoy67
12-19-2014, 07:07 PM
I get that, but wouldn't the root node still show on the breadcrumbs as the final thing, so even if I made the news section the homepage (which is the same script as the root node except with some section info in the url) I'm not quite sure it would fix the issue.

--------------- Added 19 Dec 2014 at 15:33 ---------------

Another question. Is it possible to have a section display only 1 item? So say I have a section called "About us" and a static page. I want the About Us section link to show the page as if the section was the page instead of listing a preview like it was an article. Possible?

In reply to the second question:
Yes, you can just use a widget for a static page. I have done this before on sites. You have to remove the primary content widget I believe.

KGodel
12-19-2014, 09:20 PM
So do I need to create a separate layout for these pages to basically have a static page widget in there?

KGodel
01-01-2015, 09:48 PM
Back from the dead, I found this code in an old post on vb.com, but it doesn't seem to work. It should add the author's avatar to the templater and allow me to use it on the article and preview templates, however it is only showing my avatar, not the avatar of the article author. Note: this is only on previews. When I view an article itself, the correct avatar shows.

(Figured I'd use this thread since it is still relevant).

require_once(DIR . '/includes/functions_user.php');
$avatarurl = fetch_avatar_url($view->authorid, true);
if ($avatarurl[0]) {
$avatarurl = $avatarurl[0];
}
/* render template and register variables */
vB_Template::preRegister('vbcms_content_article_pa ge',array('avatarurl' => $avatarurl));
vB_Template::preRegister('vbcms_content_article_pr eview',array('avatarurl' => $avatarurl));


And another question, I see that I can choose sections to display on a page, but there isn't an option to only show articles from a certain category within that section. Is this intended or am I using the wrong widget in the layout?

And one last question, the CMS preview tries to pull an image for the "preview" of the article, and then disables any images in the post from showing in it. Can I turn this off and allow the previews to show the images?

KGodel
01-04-2015, 05:54 AM
Friendly bump. The most pertinent question is the code I provided for the avatar. ^^ Everything else can be worked around I suppose. ^^

Dead Eddie
01-04-2015, 11:34 AM
What hook are you using?

KGodel
01-04-2015, 04:34 PM
vbcms_article_populate_end

I read somewhere this was the appropriate hook.

Dead Eddie
01-04-2015, 10:58 PM
It seems to work correctly on my test install. Maybe another plugin is interfering?

KGodel
01-04-2015, 11:03 PM
On the previews it shows other people's avatars? It works for me, however only my avatar appears, even if I am not the author of the article.

Dead Eddie
01-04-2015, 11:20 PM
Two authors:

string 'image.php?u=2&dateline=1420404720&type=thumb' (length=52)
string 'image.php?u=1&dateline=1420403212&type=thumb' (length=52)
string 'image.php?u=1&dateline=1420403212&type=thumb' (length=52)
string 'image.php?u=1&dateline=1420403212&type=thumb' (length=52)
string 'image.php?u=1&dateline=1420403212&type=thumb' (length=52)
string 'image.php?u=1&dateline=1420403212&type=thumb' (length=52)
string 'image.php?u=1&dateline=1420403212&type=thumb' (length=52)

--------------- Added 1420421196 at 1420421196 ---------------

I lied. Somehow it got changed going into the template.

--------------- Added 1420421442 at 1420421442 ---------------

This worked for me:

require_once(DIR . '/includes/functions_user.php');
$avatarurl = fetch_avatar_url($view->authorid, true);
if ($avatarurl[0]) {
$avatarurl = $avatarurl[0];
}
/* render template and register variables */

$view->avatarurl = $avatarurl;

KGodel
01-05-2015, 12:46 AM
Will try.

Edit: it works, thanks. Could you explain why your change worked so I can know for future reference? My guess is that pre-registering only did the value of one thing and once that value was registered any change afterward will affect the variable?

Any help on the additional questions would be appreciated (from anyone). Thanks for the help!

Dead Eddie
01-05-2015, 11:59 AM
Could you explain why your change worked so I can know for future reference?

It's just the way the CMS works. If you're sending values to the template, the fastest, easiest, and best way to to do it is to add it to the view directly (the view is responsible for knowing everything about rendering output to the screen).

I didn't track your code back to see why the values were being changed, so I don't know why it wasn't working correctly.

KGodel
01-17-2015, 06:50 PM
Okay, I've figured out most of this, but I have a question: I created sub-sections and allow them for sub-nav, but there aren't any sub-menus (like you can create in the normal namv manager). Am I missing something when it comes to these?

I'm also still looking for a way to display images in a preview normally.

KGodel
01-27-2015, 02:52 AM
So, after updating to the latest patch, the plugin is no longer passing the avatar to the template. :/

Dead Eddie
01-27-2015, 12:31 PM
That's odd.

I'll take a look at it.

KGodel
01-30-2015, 01:40 AM
Thanks Eddie.

Also, thanks to HM666 who helped me finally get the CMS menu to play nice. It's finally behaving (almost) like I want it to.

I'm still searching for ways to disable the CMS's suppression of in-article images on the previews if anyone can help.

KGodel
02-08-2015, 06:21 PM
Thanks to Dead Eddie for helping me out with the avatar issue. Now all I need is to disable the CMS from automatically removing images from previews. Any help would be appreciated.

Dead Eddie
02-08-2015, 07:02 PM
Looks like it's in vB_BbCodeParser::getPreview()

//If this has [ATTACH] or [IMG] or VIDEO then we nuke it.
$pagetext =preg_replace('#\[ATTACH.*?\[/ATTACH\]#si', '', $token['data']);
$pagetext = preg_replace('#\[IMG.*?\[/IMG\]#si', '', $pagetext);
$pagetext = preg_replace('#\[video.*?\[/video\]#si', '', $pagetext);

KGodel
02-08-2015, 07:15 PM
I found the code and commented it out, and now it shows the code, but isn't parsing anything...

Dead Eddie
02-09-2015, 01:29 AM
Up a few lines in the same method...

$this->options = array(
'do_html' => $do_html,
'do_smilies' => false,
'do_bbcode' => true,
'do_imgcode' => false,
'do_videocode' => false,
'do_nl2br' => $do_nl2br,
'cachable' => true
);


Set these in accordance with what you want parsed.

KGodel
02-09-2015, 01:53 AM
Saw that and tried as well with no luck. ^^ Also cleared my cache as well and no change.

Dead Eddie
02-09-2015, 02:59 AM
Sorry, yeah. You need to load the Image BBCode parser into the method. You can look at the way it's done in the parse method as an example.

KGodel
02-13-2015, 04:59 PM
Alright. I'll try to find where to do that. Thanks for the help.

KGodel
03-08-2015, 02:07 AM
Hey guys, I'm still having no luck figuring out where to add/remove code to parse the BBCode in article previews. ANy help would be great!

KGodel
03-11-2015, 09:54 PM
Still working on the above issue, but I have another concern.

I have some PHP I'd like to put in a CMS direct evaluation. I followed the rules, doing anything but then setting the $output variable, but all I get is a white page. I have tested this code via a plugin we have to create pages via the forum and it works as intended. Are there functions that are disallowed in the CMS?

KGodel
03-13-2015, 06:58 PM
Hey guys. So the BBCode issue is still one I need help solving. I have it displaying but not being executed. Second, the PHP I am attempting to put in a direct evaluation page through CMS is below, except I have changed everything from "echo" to $var = or$var.=, then set $output = $var; at the end. This code IS working on the site on a non-VMS page.

//Get List of Divisions
$sql = "SELECT * FROM " . TABLE_PREFIX . "gamelist ORDER BY gamename ASC";
$result = $db->query_read_slave($sql);

// Start Division/Area List
$areas = ["Administration", "Clan Staff"];
$alist = "'Administration', 'Clan Staff'";

while ($g = mysql_fetch_array($result)) {
$areas[] = $gn = $g[1];
$alist .= ", '$gn'";
}
$areas = ["Games in Progress"];
$alist .= ", 'Games in Progress'";

// Get the Staff Members
$sql = "SELECT * FROM " . TABLE_PREFIX . "staff ORDER BY FIELD(divdept, $alist), position DESC, username DESC";
$result = $db->query_read_slave($sql);

//Begin Output (Hopefully)
echo "<p> Zealot Gaming hosts a variety of leaders in order to help ensure that all aspects of the clan are taken care of and any issues members have may be resolved at any time. For a list of positions, please visit the&nbsp;<a href='index.php/info/clan-structure' target='_self'>structure page</a>.</p>";

// Set basic cell counter
$i = 1;

// Set previous area to nothing damnit.
$prev = "";

//Go through each staff member
while ($u = mysql_fetch_array($result)) {

// Let's set our data.
$userid = $u[0];
$username = $u[1];
$rname = $u[2];
$rank = $u[3];
$area = $u[4];
$facebook = $u[5];
$twitter = $u[6];
$bio = $u[7];
$img = "images/staff/" . strtolower($username) . ".png";
$email = strtolower($username) . "@zealotgaming.com";

// Check for Social Media code.
if (!empty($facebook)) { $facebook = "&nbsp;&nbsp;<a href='$facebook'><img alt=\"$username's Facebook\" src='images/staff/social/facebook.png' /></a>"; }
if (!empty($twitter)) { $twitter = "&nbsp;&nbsp;<a href='$twitter'><img alt=\"$username's Twitter\" src='images/staff/social/twitter.png' /></a>"; }

//Is this a new area?
if ($area != $prev) {

// Yes
// Do we need to close the previous table and add a cell?
if ($i % 2 == 0 && !empty($prev)) {
//Add a cell and close
echo " <td valign='top'>&nbsp;</td>
</tr>
</table>";
} elseif ($i % 2 == 1 && !empty($prev)) {
//Just close the table
echo "</table>";
}

// Reset the column we're in.
$i = 2;
$prev = $area;

//New Area Heading
echo "<h2 class='whiteglow' style='margin-bottom: 10px;'>$area</h2>";

//Start of Table
echo "<table border='0' cellpadding='1' class='zebra' style='width: 100%;'>";

// First column, new row.
echo "<tr>
<td valign='top' width='50%'><div style='float: left; margin-right: 10px;'> <img alt='$username' height='110' src='$img' width='110' /></div>
<div style='float: right;'> <a href='mailto:$email'><img alt='Email $username' src='images/staff/social/email.png' /></a>".$facebook.$twitter."</div>
<strong>User</strong>: <a href='member.php?u=$userid'>$username</a><br />
<strong>Name</strong>: $rname<br />
<strong>Position</strong>: $rank<br />
<strong>Bio</strong>: $bio</td>";
} else {

//No

// Is this a new row?
if ($i % 2 == 0) {

//No
// Enter the information then close the row
echo " <td valign='top' width='50%'><div style='float: left; margin-right: 10px;'> <img alt='$username' height='110' src='$img' width='110' /></div>
<div style='float: right;'> <a href='mailto:$email'><img alt='Email $username' src='images/staff/social/email.png' /></a>".$facebook.$twitter."</div>
<strong>User</strong>: <a href='member.php?u=$userid'>$username</a><br />
<strong>Name</strong>: $rname<br />
<strong>Position</strong>: $rank<br />
<strong>Bio</strong>: $bio</td>
</tr>";

//Set our cell counter
$i++;
$prev = $area;

} else {

//No
// Start a new row.
echo "<tr>
<td valign='top' width='50%'><div style='float: left; margin-right: 10px;'> <img alt='$username' height='110' src='$img' width='110' /></div>
<div style='float: right;'> <a href='mailto:$email'><img alt='Email $username' src='images/staff/social/email.png' /></a>".$facebook.$twitter."</div>
<strong>User</strong>: <a href='member.php?u=$userid'>$username</a><br />
<strong>Name</strong>: $rname<br />
<strong>Position</strong>: $rank<br />
<strong>Bio</strong>: $bio</td>";

//Set our cell counter
$i++;
$prev = $area;
}

}
}

// Do we need to close the previous table and add a cell?
if ($i % 2 == 0 ) {
//Add a cell and close
echo " <td valign='top'>&nbsp;</td>
</tr>
</table>";
} else {
//Just close the table
echo "</table>";
}

KGodel
03-16-2015, 02:13 PM
Summary: DIV is supposed to include PHP output, instead div is there but contains nothing (even though the php code is in the div) and preview output is below it.

EDIT: Contained everything in a div with max height 100% and that seemed to fix it.

Now, about that BBCode in article previews....