Customizing SMF > SMF Coding Discussion
Query for Traffic
Joker™:
--- Quote from: colby2152 on August 03, 2011, 09:53:34 PM ---Hmmm, I didn't edit that code and it threw an error.
--- End quote ---
When you go to a doctor you don't tell him that you are ill, you tell him about your exact illness issue. Similarly, when a code doesn't work you are supposed to tell the coder about
- What didn't worked exacty
- What was the error
Have you changed the board id as per your forum requirements?
Have you changed the time variables as per your forum requirement?
--- Quote ---What about database IDs?
--- End quote ---
Which IDs?
colby2152:
Well, where do I place this code? Can I place it in a Simple Portal PHP block? db_prefix.... does that change?
Joker™:
--- Quote from: colby2152 on August 10, 2011, 09:49:49 PM ---Well, where do I place this code
--- End quote ---
The code posted above gives you complete freedom to show the count result anywhere.
Just call this file and function in the the template file you want to show the result.
Like
--- Code: ---require_once['above_file_name.php']
num_views();
--- End code ---
--- Quote ---Can I place it in a Simple Portal PHP block?
--- End quote ---
No idea, I think on this someone else can answer you better as I've never used the portals.
--- Quote ---db_prefix.... does that change?
--- End quote ---
SMF is going to pick your DB prefix itself by inbuilt functions.
Joker loves SMF coz of these reasons ;D.
colby2152:
Wait, so I should add this code to a php file instead? Any way that I can have it embedded into a form?
Joker™:
--- Quote from: colby2152 on August 11, 2011, 10:28:48 AM ---Wait, so I should add this code to a php file instead?
--- End quote ---
Yes.
--- Quote ---Any way that I can have it embedded into a form?
--- End quote ---
--- Quote from: Joker™ on August 11, 2011, 09:53:28 AM ---The code posted above gives you complete freedom to show the count result anywhere.
Just call this file and function in the the template file you want to show the result.
Like
--- Code: ---require_once['above_file_name.php']
num_views();
--- End code ---
--- End quote ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version