Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


gizmola last won the day on June 21

gizmola had the most liked content!

Community Reputation

142 Excellent

About gizmola

  • Rank
    Prolific Member

Contact Methods

  • AIM
  • Website URL

Profile Information

  • Gender
  • Location
    Los Angeles, CA USA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. gizmola

    music fonts required

    Here's a list of SVG editors. If you don't know which one to try first, I would suggest Inkscape, which has been around a long time and is used by a lot of people.
  2. gizmola

    Current counter currently my page

    And what do you want to do with this count? Realistically, your count will never be more than 1 (unless you are being visited by a bot). Very few sites have significant traffic without having been around for a long time, or having had a significant advertising and marketing budget or some other phenomenon that is attracting visitors and traffic. The simplest way to see what is going on is also 100% free to you -- Google Analytics. Just hit Analytics for your site and click on Real time.
  3. Actually when you see a style with the strikethrough that tells you it was overridden. Here's a decent article on how specificity works.
  4. Essentially you want to learn about the box model which is also helpfully illustrated at the bottom of the dev tools screen. You've got margin, border, padding and content size. Check out this article: As to how to position things, it's dependent on your markup, and your css. In general there are sandboxes galore for experimenting. I'd recommend https://codepen.io/ If you can provide us the html and css, as well as the specific issue you are facing, we could be a lot more helpful. You could also put this in a codepen which makes it easy for people to fix the issue and share the solution back to you.
  5. You should be testing this in chrome. You put your cursor on the logo and right click. From the popup menu, you choose Inspect. You can move your cursor around inside and Chrome will hilight the HTML element that is being inspected. On the right side of the Dev tools window you should see all the styles being applied to the element and where they come from. It will also show you when styles are being overridden. It should look something like this:
  6. Have you used the Chrome Dev tools to look at the style rules for the logo (without the attributes?) It should allow you to trace where the rules are coming from. First rule out syntax errors in your css, then take a look at specificity of the css you are using (tag, id, class?)
  7. gizmola

    Wordpress/Php help

    This is truly hacking your site in the worst possible interpretation of the word. The rel attribute has nothing at all to do with a class of the category tag. Wordpress already outputs a custom class in the category list. The code that does this is in Walker_Category and inspection of the page in chrome tools should reveal the inclusion of those css classes in the form of 'cat-item-' . $category->term_id So all that should be required is actually adding the appropriate css style for each individual category. Your posts seem to have the recurring issue that you start with: "I want to do <insert specific thing>" rather than, "My client wants <description> functionality on their Wordpress x.x site." The quality of the help you get will be much better if you start with the Macro view of the problem, then drill into the specifics.
  8. You have at least 2 problems in your code: You don't seem to be familiar with the basic rules of PHP variable scoping. You have a function fWineStats(). Inside that function you attempt to reference an object $conn and call a method $conn->query(). The problem is that you did not pass the $conn object into fWineStats() as a parameter, or declare $conn inside the function as a global variable. The simplest solution would be to change the function to pass in the parameter, but you will also need to update wherever fWineStats() is actually called. That is not shown in your code. Your return values are also messed up. You are returning an array with variables that don't exist in your function ($NWP, $NBP). Personally I don't see why you would be trying to return an array when really what you want to return is return a single row. I did my best to guess what you really wanted, and just returned the row fetched. function fWineStats($conn, $W_YR){ $sql_NWP = "Select Count(A.PurchaseID) as NWP, Sum(A.PurchaseQuantity) as NBP From tblWinePurchased A Inner Join tblVisits B on A.PurchaseVisit = B.VisitID WHERE EXTRACT(YEAR from B.VisitDate) ='" . $W_YR . "' Group By EXTRACT(YEAR from B.VisitDate)"; //var_dump($sql_NWP); $result_NWP = $conn->query($sql_NWP) or die($conn->error); $row_NWP = $result_NWP->fetch_assoc(); return $row_NWP; }
  9. If the unit has an internal 3.5" bay I don't see why you couldn't. Seems dependent on the case you are using.
  10. gizmola

    Breaking php array into smaller arrays

    I agree with benanamen on this one. It would have been helpful if you had stated that you needed to take the input data, which was described well, in order to feed it into one or more graphs you are going to render using Graph.js. The specific graphs would be helpful to know as well. This would certainly have allowed people to provide you better and more specific advice. Hopefully, this advice will aid you in the future as to how to ask more precise questions in the future! To be clear though, given your described input, combine my solution with Barand's and you have the 3 arrays you are looking for on the serverside. It might be of interest to other people if you can report back with the code you came up with to render the graphs.
  11. gizmola

    Breaking php array into smaller arrays

    What is the benefit of having 3 separate arrays? Here is some code to convert this into an array that would allow you to utilize Barand's solution although I really see no benefit in having 3 uncollated arrays. <?php $keys = array('name', 'age', 'weight'); $original = array('Chris', 23, '12stone', 'Paul', 28, '11stone'); foreach(array_chunk($original, 3) as $values) { $new[] = array_combine($keys, $values); } var_dump($new); Output: array(2) { [0]=> array(3) { ["name"]=> string(5) "Chris" ["age"]=> int(23) ["weight"]=> string(7) "12stone" } [1]=> array(3) { ["name"]=> string(4) "Paul" ["age"]=> int(28) ["weight"]=> string(7) "11stone" } }
  12. A symlink does not magically give you rights to anything that you don't have rights to on the non-symlinked folder, both from an ownership and permissions standpoint. It would also help if you specified what web server/php configuration you are running. There are settings like FollowSymlinks you might need to investigate and verify.
  13. gizmola

    Injecting arguments in constructors

    I'm glad you got the main point of my comments, being, don't try and hide dependencies inside an array you pass to the constructor. Your examples look similar to the type of code often associate with micro frameworks like Lumen, slim or silex. Looks fairly kosher to me given the limited context.
  14. gizmola

    Question regarding templates

    I would say that the standard for this would be creation of a style guide, which is a typical first step for a professional website designer. Things like a logo need to be seperate deliverables to be included into the style guide. Once the style guide exists, both the site template and letterhead can be derived and should look to be parts of the same thing. Take a look at this article: https://designmodo.com/create-style-guides/
  15. gizmola

    Injecting arguments in constructors

    I think you have to be careful with the terminology you are employing. An argument is by definition "injecting" variables into a function or method. In general the important distinction is how an argument is passed. Passed by Value: Changes to the argument don't change the original variable Passed by Reference: Changes to the argument change the original variable A fundamental change in PHP from version 4 to 5 was that all objects get passed by reference. In PHP 4 you frequently had to employ the 'reference' operator. So when the word "injection" gets used, it's in reference to "Dependency Injection". Obviously that is large topic, but it's predicated on the idea that you will inject objects that a class might depend on via the constructor. Since code in the class will reference this dependency, it should be a parameter and not passed in via an array. Now in terms of your specific example having to do with form data, it is hard for me to see the value of what you are doing when form data exists within PHP in a super global ($_POST). If you look at most of the frameworks, all of which have some support or solution for form building, validation and error handling, doing what you are doing is an anti-pattern. What you see more of is the use of a Request object that gets the raw form data from the request, then applies validations and updating of model objects as required. Just mapping an array of variables into an object seems of limited value.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.