Important Notice: Effective immediately, all support will be handled through Discord. Read more about the changes coming to Anodyne's services.

PHP Problems

Nova includes a new and robust way of skinning the entire system without ever touching the core of the application. If you have questions about how to build a theme for Nova, how to modify a theme or you just want to show off your work, this is the place to do it!

Emily Sun May 24, 2015 6:20 pm

PHP Problems

I've been playing around with my sites personnel manifest page and I've stumbled across some php errors. I've tried to model it off of what I've seen from http://ussnimitz.net, but with my character buttons the char id tag sends it to a different char id than what is being displayed. I'm not sure why it's doing it or how to fix it.

I'd also like to know how to insert character images in to the page as well, but I'm not sure exactly which php tag I should be using. :-/

Here is the link to my site: http://hyperion.wolfsims.net/personnel/index

Any help is appreciated! :)
Image

Anodyne Productions :: DiscordHelp CenterXtras

Discord: @Emily#6153
Xtras: @Emily
GitHub: @ewolf90
User avatar

Posts: 71


Emily Sun May 24, 2015 7:48 pm

Re: PHP Problems

So, it appears to be adding a "1" to the end of each $char['char_id'] when it's printing it. I'm also curious as to why sometimes the default bio page can appear in two different ways. One that seems more vertical and the other more horizontally based when displaying the position, rank, avatar, and others.
Image

Anodyne Productions :: DiscordHelp CenterXtras

Discord: @Emily#6153
Xtras: @Emily
GitHub: @ewolf90
User avatar

Posts: 71


Emily Sun May 24, 2015 7:57 pm

Re: PHP Problems

I fixed the error with the php adding the "1" to the end, but I'd still like to know the code that was used to add in the character image as well as why the character bio pages' format changes sometimes.

Thanks! :)
Image

Anodyne Productions :: DiscordHelp CenterXtras

Discord: @Emily#6153
Xtras: @Emily
GitHub: @ewolf90
User avatar

Posts: 71


AgentPhoenix Sun May 24, 2015 8:00 pm

Re: PHP Problems

It'd be almost identical (if not completely identical) to how the bio page does the primary image for the character. Take a look at that to get you moving in the right direction.
User avatar

Posts: 7596


Emily Wed May 27, 2015 7:09 pm

Re: PHP Problems

I've been trying for a bit, but I can't figure out how to get the correct image to appear.

This is what I have so far:
Code: Select all
         <?php if (isset($character['image']['src'])): ?>
            <?php echo img($character['image']);?>
               
         <?php else: ?>
               <?php echo img($character['noavatar']);?>
         <?php endif;?>


Am I in the ball park? lol

(hint: if you haven't guessed, php isn't my strong suit. lol)

Also, AgentPhoenix, how did you make it so that the rank name would not appear on the personnel page but it will still appear on the bio pages?
Image

Anodyne Productions :: DiscordHelp CenterXtras

Discord: @Emily#6153
Xtras: @Emily
GitHub: @ewolf90
User avatar

Posts: 71


AgentPhoenix Wed May 27, 2015 7:23 pm

Re: PHP Problems

The character image doesn't exist, you need to create it from the controller and pass it to the view. You'll need to start by looking at how the bio page handles building those images and then do the same type of thing on the index method of the personnel controller so you can use it in the manifest view.
User avatar

Posts: 7596


Emily Wed May 27, 2015 10:21 pm

Re: PHP Problems

Got that to work, thanks! :)

Now, where would one find the $postcount, $logcount, and $newscount controllers? I looked in the character controller, but it isn't in with that.
Image

Anodyne Productions :: DiscordHelp CenterXtras

Discord: @Emily#6153
Xtras: @Emily
GitHub: @ewolf90
User avatar

Posts: 71


AgentPhoenix Thu May 28, 2015 5:59 am

Re: PHP Problems

Unfortunately there are no relationships between the character and object to do easy counting so if you want to pull a character's counts like that, you'll need to look at the post, log, and news models and use the appropriate methods to get those values. For example, the posts model has a count_character_posts that accepts the character ID as its first parameter. During the foreach loop, you'd have to call those different methods and assign them to variable to get those different count to use in your views.
User avatar

Posts: 7596


Emily Tue Jun 02, 2015 5:33 pm

Re: PHP Problems

Another php questions, where is $tabs given it's properties, like it's class? I've looked through everything I can think of and nothing else comes to mind...
Image

Anodyne Productions :: DiscordHelp CenterXtras

Discord: @Emily#6153
Xtras: @Emily
GitHub: @ewolf90
User avatar

Posts: 71


AgentPhoenix Tue Jun 02, 2015 8:50 pm

Re: PHP Problems

Probably in the controller method. Everything the view receives, it gets from the $data array in the controller method. It's really just a matter of tracking down what you're looking for.
User avatar

Posts: 7596


AlPrunty Sun Jan 31, 2016 6:18 am

Re: PHP Problems

Some hosts are turning on the ModSecurity which causes a lot of problems with Nova... this needs to be turned off. Search ModSecurity in your cPanel if you are on a WHM/cPanel site.

http://prntscr.com/9x5glo

Posts: 12



Return to Skinning

Who is online

Users browsing this forum: No registered users and 1 guest

cron