This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Unique Variable Names
#1

Hi.
Commentics work on other simple php_script.
Ex.hello.php
<?
echo 'hello';
?>

But,Commentics doesn't work on a complex/advanced PHP program.

MayBe Variable scope truble.
Commentics's variable that has already been used is used.
Ex. $page_id,$database,
defined SUCCESS_TEXT,TODAY,YESTERDAY

Please use Unique(peculiar) name Variable.
Ex.
$page_id --> $cmtics_page_id
$database --> $c3tics_database
SUCCESS_TEXT --> CTICS2010_SUCCESS_TEXT

---------------------------------------------------
Commentics's Japanese Commentary Site
http://commentics.bbfriend.net/
*Sorry...I am not good at English.
---------------------------------------------------
Reply
#2

Hi, a similar bug has been reported about the function names. This will be fixed in the next release. I can understand how the defined text could be an issue but are you sure that the variable names are causing a problem as well?

Have you completed the interview?
Reply
#3

Hi.
Overlaps/Repetition(already been used is used)..
It is very difficult to find it.
Because it is grammatically correct. No Error
Being possible to do .add defined(),issset(),unset(),empty()..

A temporary/tentative method of settlement..
Unique(peculiar) name ..
Ex.
clean_url() --> cmtx_clean_url()
$page_id --> $cmtics_page_id

BUT,A fundamental method of settlement..
class definitions/Object-oriented
http://www.php.net/manual/en/language.oop5.basic.php
Like PEAR(PHP Extension and Application Repository).
If developed, It is possible to become one of the most excellent comment systems.

---------------------------------------------------
Commentics's Japanese Commentary Site
http://commentics.bbfriend.net/
*Sorry...I am not good at English.
---------------------------------------------------
Reply
#4

I have studied OOP in depth but I'm a procedural programmer and I don't envisage that changing so it's unlikely that you will ever see any classes in Commentics.

Have you completed the interview?
Reply
#5

From what I understood, you're suggesting taking a more object-oriented approach by using classes. That actually is a good idea, but it will take some time to rewrite the script which probably won't happen by the next version. Variables shouldn't be a problem unless some script that pretty much makes the web page is wrapped around Commentics (sorry if I explained it badly). What currently is being done is adding "cmtx_" in front of each function to avoid conflicts with other scripts. Not sure whether or not variables will be changed, but it might be worth it.

EDIT: well, Steven beat me to the post while I was writing mine.

I'm giving you three guesses...
Reply
#6

The defined text could definitely be a problem because an error will be displayed if any code attempts to re-define something. However it's not clear from utaka's post (at least to me anyway) whether this has actually happened or whether it could in theory happen.

Have you completed the interview?
Reply
#7

Hi!
I was given up because it did not work.
CMS is LightNeasy Mini.

It tests with different software now. work fine!

---------------------------------------------------
Commentics's Japanese Commentary Site
http://commentics.bbfriend.net/
*Sorry...I am not good at English.
---------------------------------------------------
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by kazakru
25-Feb-2023, 12:43 PM
Last Post by hentes
20-Dec-2016, 09:28 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)