KevyNC Posted April 5, 2019 Report Share Posted April 5, 2019 54 minutes ago, cfj said: What I would suggest, are that you on your download page will inform us users that your script only works with the TNG-WordPress plugin. You have done a great job with the list events, but they don't seems to work for all of us. No, I don't or never have used the TNG-WordPress plugin, just on an old test site I never got the TNG plugin to work on my site either, but then I never really understood how to make it work. It may have to do with the themes I tried, or the version(s) of Wordpress. Curious to know what themes and versions of Wordpress users have been successful. Something as simply changing a line (or three) of code such as: get_option('tng_url') vs get_option('mbtng_url') might make all the difference with some of these issues. Or it code be due to a combination of plugins and/or CSS code mods that work together (or not) to produce the result (or not) Kevin Quote Link to comment Share on other sites More sharing options...
theKiwi Posted April 5, 2019 Report Share Posted April 5, 2019 The history of these add-ons for birthdays, anniversaries, deaths, surnames, surname cloud etc is that they were developed first to work as add-ons for TNG sites - so usually people put them on their index.php page using the include statements and they worked. They contained switching in them so that you could see them included into a TNG page - index.php usually, but could also work if called directly to the add-on script. So http://LisaAndRoger.com/tng/index.php is my index.php page running as TNG only and http://LisaAndRoger.com/tng/userscripts/list_birthdays.php is the call direct to the birthdays list Then I got interested in having a site with WordPress and TNG combined, and the plugin that was written by Mark Barnes was available, so I used that to get TNG to integrate into WordPress, but found that the plugin needed some changes to work as TNG was updated, so Darrin and I made some changes to both TNG and the plugin to keep it working with TNG 9 at first I think it was. Mark Barnes abandoned the plugin, but did make me a Contributor so it could be kept updated through the WordPress plugin repository which I have done a few times. Another update to TNG completely broke the ability to synchronise logins between WordPress and TNG, and that is not something I have figured out how to fix. But once I had WordPress and TNG working together the list_ add-ons wouldn't work, so I added code to them to determine if they were running inside of WordPress - if so do one thing, if not then decide if it was running in TNG, or called directly. The if ( function_exists ('get_option') ) line is there just to determine if WordPress is in use, since "get_option" is a WordPress function, and if WordPress is in use, then the paths to the scripts had to be changed. But this didn't account for people who used WordPress without the plugin - i.e. the Kloosterman Method. I haven't installed a setup like that so don't know exactly how things behave in that environment. One of these days I'll stumble upon the reason that you can only call once to these add-ons per page, but so far that has eluded me, just as the problem with curly quotes and extended characters fail in the add-ons too, even though the entire path is UTF-8 from the database through TNG and WordPress all set to UTF-8, they come out to display as ISO-8859-1. Roger Quote Link to comment Share on other sites More sharing options...
KevyNC Posted April 5, 2019 Report Share Posted April 5, 2019 55 minutes ago, theKiwi said: One of these days I'll stumble upon the reason that you can only call once to these add-ons per page, but so far that has eluded me, just as the problem with curly quotes and extended characters fail in the add-ons too, even though the entire path is UTF-8 from the database through TNG and WordPress all set to UTF-8 I really do not have any knowledge on how the stuff works behind the scenes, but my first thought would be related to how things are called....(sort of like a parallel versus sequence circuit) ... because the code/scripts are "including" other PHP code (and usually mostly the same ones) could that be a contributing factor when they are on the same page but not in same container? Quote Link to comment Share on other sites More sharing options...
KevyNC Posted April 5, 2019 Report Share Posted April 5, 2019 Not sure if this relates to anything or is of any help -- something to explore -- checks to see if ($conn->connect_error) IF not is executes code -- see below for sample code https://www.w3schools.com/php/php_mysql_select.asp <?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "myDB";// Create connection $conn = new mysqli($servername, $username, $password, $dbname);// Check connectionif ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT id, firstname, lastname FROM MyGuests"; $result = $conn->query($sql);if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>"; } } else { echo "0 results"; } $conn->close();?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.