Jump to content
TNG Community

Search the Community

Showing results for tags 'code'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • TNG Specific
    • Announcements
    • Questions and Answers
    • Installation and Configuration
    • New Ideas and Suggestions
    • Code Discussion
    • Templates or Design Questions
    • CMS Integrations
    • TNG Wiki
  • Community
    • Member Webpages
    • Genealogy
    • Chit Chat
    • Questions and Answers
    • Offers And Requests

Blogs

  • Community News
  • TNG News

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 106 results

  1. Hi, I have a problem with displaying TNG help pages. Environment and TNG installation: I have installed "DesktopServer Limited" v3.8.3 (by ServerPress.com) on one of my Windows 10 Home PCs. The Apache, PHP and MySQL version-releases can be seen on attached screen copy of TNG Setup>>Diagnostics page. To install TNG I downloaded v 11.1.2 zip file and copied it to DesktopServer C:\xampplite\blueprints folder Using DesktopServer I created a local site www.tngtest1.dev from "blueprint" tngfiles1112.zip (Note! This site is not visible from internet) DesktopServer creates a virtual host by adding the following line in Windows hosts file ( C:\Windows\System32\drivers\etc\hosts ): 127.0.0.1 www.tngtest1.dev I created a new mysql database for TNG using phpMyAdmin with collation utf8_swedish_ci I created a database admin user with ALL PRIVILEGES and with HOST field set to localhost A TNG Regular installation was done and everything went OK. Database Host Name set to localhost and TNG tables created with collation utf8_swedish_ci Launched page www.tngtest1.dev/admin.php in FireFox and created a TNG admin user. Login to TNG with Admin user and checked: Setup >> Configuration >> General Settings > Database > Database Host: localhost Checked: Setup >> Configuration >> General Settings > Site Design and Definition and changed Genealogy URL from www.tngtest1.dev to localhost So far so good Problem and Error message: Using the TNG panels works fine but when trying to access TNG help pages I get error: Error: TNG is not communicating with your database. Please check your database settings and try again. Settings can be found under Admin/Setup/General Settings/Database, or at the top of your config.php file. Debugging done: I found an earlier forum topic on this issue but it did not conclude what the error cause is. I have done some debugging and found the following: The TNG help files are basically just html but most of them begin with including a "TNG help header". Here is a code snippet: <?php include("../../helplib.php"); echo help_header("Help: General Settings"); ?> Now helplib.php looks like this: <?php function help_header($helptitle) { $relpath = "../../"; include($relpath . "begin.php"); include($relpath . "version.php"); $header = $tngconfig['doctype'] ? $tngconfig['doctype'] . *** text excluded from code extract *** *** lines excluded from code extract *** return $header; } global $link; ?> So helplib.php includes begin.php In begin.php the last php statement contains a function call of tng_db_connect(): $link = tng_db_connect($database_host,$database_name,$database_username,$database_password,$database_port,$database_socket); I added some echo statements before the function call and found that the problem is that "$database_..." variables are not set (=empty) when function tng_db_connect is called. And this is strange since earlier in begin.php the file config.php (where these variables are set) is indeed included with statement: include($tngconfig['subroot'] . "config.php"); which I checked resolves to include("config.php") in my environment. And even more strange is that the include of config.php works flawless in the "admin_***.php" files. (Yes, I have tested it) Solution found to work: I added an include of config.php in helplib.php as follows (see line in blue color): <?php function help_header($helptitle) { $relpath = "../../"; include($relpath . "config.php"); // Added to make Help pages work in DesktopServer environment include($relpath . "begin.php"); include($relpath . "version.php"); $header = $tngconfig['doctype'] ? $tngconfig['doctype'] . *** text excluded from code extract *** *** lines excluded from code extract *** return $header; } global $link; ?> As far as I have seen so far this solves the problem. Question: Any ideas on what might cause this problem? I can do further debugging as needed, feel free to guide me. Regards Bosse
  2. KmBdev

    Custom event with hyperlink

    I have tng in word press using the wordpress plug in. I have a custom event "Links" which lists mainly the name of battles the person was involved in. What I would like to do is make the battle name, in my custom event, link to a wordpress page I have in my web site about the battle. Is there any way to do this? Thank you for any help.
  3. XerxX

    Fan Chart Text-align Fix

    Hi all, I just upgraded to v11 and found the Fan Chart really nice. There is, however, in my view a problem in generation 5: There is too much space "above" the text/name: . I have found how to tweak it (and I also add some space for generation 3) and post it here in "Mod-format": %target:fan.php% %location:% // console.log("placeWrappedText: %s",pText); %end:% %insert:before% if (gens == 4) originY -= 16; // Modfd: Remove space from gen 5 if (gens == 2) originY += 8; // Modfd: Add space to gen 3 %end:% The result for generation 5: I DON'T post this as a Mod in the TNG Wiki because I suppose it will soon be fixed by Darrin. He's notified of this. (If you think it should be a Wiki Mod: Be my guest to post it!) Regards, Erik
  4. I recently upgraded from version 9 to version 11. I also upgraded PHP and MySQL. Somewhere along the way I lost the links to all of my images. The personal pages show that there are documents or pictures, but there is only a broken image icon showing. When I FTP into my site I can see that all of the images are still in their folders. I went to General settings and tried to add a “direct path(?)”, but now when I go to my site I just get this list of Warning Fail Errors. ____________________ Warning: include(/wissersitecss/tng/config.php): failed to open stream: No such file or directory in /home/content/20/4982920/html/wissersitecss/tng/begin.php on line 11 Warning: include(): Failed opening '/wissersitecss/tng/config.php' for inclusion (include_path='.:/usr/local/php5_4/lib/php') in /home/content/20/4982920/html/wissersitecss/tng/begin.php on line 11 Warning: include(/wissersitecss/tng/templateconfig.php): failed to open stream: No such file or directory in /home/content/20/4982920/html/wissersitecss/tng/begin.php on line 15 Warning: include(): Failed opening '/wissersitecss/tng/templateconfig.php' for inclusion (include_path='.:/usr/local/php5_4/lib/php') in /home/content/20/4982920/html/wissersitecss/tng/begin.php on line 15 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/content/20/4982920/html/wissersitecss/tng/begin.php:11) in /home/content/20/4982920/html/wissersitecss/tng/begin.php on line 28 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/20/4982920/html/wissersitecss/tng/begin.php:11) in /home/content/20/4982920/html/wissersitecss/tng/begin.php on line 28 Error: TNG is not communicating with your database. Please check your database settings and try again. Settings can be found under Admin/Setup/General Settings/Database, or at the top of your config.php file. ___________________ My first question is where can I go to remove that “Direct Path” since I can no longer reach my General Settings Page? My next question would be how can I restore links to my image files so they will show up on a person’s page. My home page: http://wisserfamily.com/tng/index.php I am running: TNG v11 If you search a name like “Steve” you will see that the images do not likn to the page. Thanks for any help, Gary
  5. Hoping someone can give me a coding tip. Currently have this line of code: $resstuff="<form method=\"post\" action='kicker.php' target='_blank'><b>RESEARCH POPULAR SITES <br />; <select onchange=submit() multiple name=\"researchlink\" size=\"3\" style=\"vertical-align:text-top;\"> <option value=$callres[0] >$rv[0]</option> ......more options </select> </form>"; ----- giving me this: I wish to have a cust_text variable in various languages I support, in the form $text[rm-header] = "Research Popular Sites". I've tried various ways such as : $resstuff="<form method=\"post\" action='kicker.php' target='_blank'><b><?php echo $text['rm-header'] ; ?><br />; but no luck. I tinker in coding, but could use help on this. Thanks, Ron
  6. I made changes to my site to allow multiple languages and the translation works great. However, I discovered when a new user tries to register, they get an error message. After looking at the tng_users table, the languageID field is not in the database. Of course, I can add this field to the table, but I need to understand why it is missing. Did I miss a step somewhere? I have been using TNG for 8 years and done many upgrades, but this is a first. Here is the message: An error has occurred in the TNG software. This could be due to a setup issue, an incomplete upgrade or a program bug. If you are the site owner, you may contact TNG support for help with this problem. Please copy the query below and paste it into your message: Query: INSERT IGNORE INTO tng_users (description,username,password,password_type,realname,phone,email,website,address,city,state,zip,country,languageID,notes,gedcom,role,allow_living,dt_registered) VALUES ("xxx","x@gmail.com","xxxx","md5","abc","999-000-9999","x@gmail.com","http://","xx","xx","CA","99999","USA","2","","","guest","-1","2017-08-07 13:06:35")
  7. Between the upgrades to WordPress as well as the TNG core, the old TNG WordPress plugin has become completely useless. This forced me to use an alternate method for integration. I chose the Kloosterman method which worked great. Unfortunately, this left me without Single Sign-In capability so that only site members would have access to the genealogy section, TNG. Even if I left the TNG directory out of all the site's navigation and links and used ROBOTS.TXT to prevent it being indexed by searchbots (at least the compliant, reputable ones,) it would still be accessible by any user (logged in or not) that entered the TNG directory address directly or had a link or bookmark that led to it. The imperfect workaround I went with was to use the .HTACCESS file to check the already existing WordPress cookie to see if a user is logged in. This applies only when they try to visit that directory or any of its subdirectories or files. If they go there and they're not logged in, they get redirected to the login page. (It's an imperfect method, because it's still hackable, but it's the best I could come up with on the spot.) <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_URI} ^.*tng/.* RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] RewriteRule . /wp-login.php?redirect_to=%{REQUEST_URI} [R,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> INSTRUCTIONS (Use at your own risk. I am will not be held responsible for any damage or losses to you or your site for trying this nor is it my responsibility to help you fix things if they break. I'm sharing a method that I use that works for me. I think it will work for most others as well, but I can't guarantee that.) Copy the code above, and be sure to change the TNG folder name to the one you use on your site. Open your own HTACCESS file, and find the basic WordPress code that looks like this: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Overwrite the part between BEGIN and END WORDPRESS with the new, edited code. Save your changes, and upload the new file back to the server. ADDITIONAL ACTIONS These are additional actions I went with for my site. I hope they help you as well. I turned REQUIRE LOGIN off so that users only had to log in to the membership section of the site once to see the full genealogy section. This keeps them from being able to edit the records. They can only suggest changes. This also prevents hackers that bypass my method above from being able to easily make changes without a login. I removed all LOGIN and ADMINISTRATION links from the TNG pages. Now I have to use my bookmarked links to get to the admin.php and login.php pages.
  8. raisondetre

    Histories - with Subfolders

    This 'should' be easy but . . . In C-panel, I created sub-folders under 'Histories' so a number of stories will be grouped with a particular family. For example, a story file name is BenjaminArgust.php which belongs with the Lawton family so I placed it under the subfolder, 16Lawton The path therefore, one would think, would be /histories/16lawton/benjaminargust.php but that does not work I CAN save benjaminargust.php directly under the Histories subfolder and that works fine: /histories/benjaminargust.php As I enter numerous essays, research articles, biographies, this will be increasingly important. I know I can name my files with lead-in codes (16 = Lawton family so the Benjamin Argust file could be renamed 16benjaminargust.php) - that would be one long list of files under "Histories" - but traditionally I created hierarchies that kept this sort of thing in order. It appears TNG does not accept 'child' folders to the sub-folder 'Histories'. Or am I missing something? Can you confirm/help?
  9. Hi folks, is it in a MOD-file possible to identify a location in a certain file and then insert something before AND after this location without repeating to locate this same location again? I know, I could do this in THIS example with one "%replace:%", but I would like to know, if it's also possible to make after the first "%location:%" two different inserts: a "%insert:before%" and directly afterwards a "%insert:after%" without repeating the red %location:% Example: Greetings from Berlin, Lübbe
  10. Hi! I am trying to figure out how to turn off or code out the description field in the headstones menu. That way it will have: the 1. thumb (with the description in the popup anyway) 2. Cemetery 3. Status 4. Link to Thanks greatly! Jeff
  11. Hi! I was wondering if anyone knew how to center the "Elusive People" and "Mystery Photos" boxes in the "Most Wanted" Menu.... I looked around and inspected, but could figure it out. Any thoughts? Thanks! Jeff
  12. Hi! I am trying to change the color attribute as seen in the background light blue box of the pedigree view in the attached pic. Is is a actual image from an img folder; or a color code attribute found in a php, css, js file? I have tried examining numerous times with the "inspect" function, but cant seem to find the right item. Thanks for the help on this one! Jeff
  13. I have been working with my Headstones. When I change to another media type that I have created to change something, the Cemetery field gets populated with the last cemetery I used in Headstones
  14. Hi! Several People have hinted on the advantage of writing a mod to save one's customizations, but how exactly do i write the mod for that? I have looked in the wiki and here on the forum, but perhaps I missed it somewhere? Thanks! Jeff :D
  15. Hi! I have spent a number of hours trying to relink the icon from my img folder to the dropdown menu. It is an additional menu i created under the "media" tab. called "GIROD records" For the life of me I have searched thru as the usual .php and .css files that would be associated. the icon still exists in the img folder. Much appreciated for any help here Jeff https://www.swissfamilygirod.com
  16. Hi! I looked in the genlib.php and a number of other places to find much less how to remove the "find a grave" and "billiongraves" from the menu tab. Any ideas? Thanks! Jeff
  17. Hi! Hopefully the right forum! It just occurred to me to ask if anyone has knowledge of how the event map maintains itself. I am currently adding my cemeteries as I find them. Some of them are very old, and I wonder if they are destroyed; will the event map be updated to the current goggle image... or will i still maintain the initial map image i geocoded? If it is updated, where perhaps is the best place to attach screenshots of the cemetery as it still exists? Thanks! Jeff
  18. Hi! I am now getting this panel warning when i do a search in admin for a cemetery==> Warning: include_once(showmodnames.php): failed to open stream: No such file or directory in /home/.../public_html/.../admin_cemeteries.php on line 304 Warning: include_once(): Failed opening 'showmodnames.php' for inclusion (include_path='.:/opt/alt/php54/usr/share/pear:/opt/alt/php54/usr/share/php') in /home/.../public_html/.../admin_cemeteries.php on line 304 how should i fix the code in these PHP's? Thanks! Jeff
  19. This is driving me nuts so I'd appreciate some help. My site http://www.combedown.org/ has a family trees section at http://www.combedown.org/tng/index.php This has worked fine for years using Cees Kloosterman's method. It was fine Sunday and not working Monday. I cant work out why except that if I view source:http://www.combedown.org/tng/index.php I can see that the code is cut short: <body> <div id="art-main"> <div class="cleared reset-box"></div> then nothing............. All the codes just not there I can get some basic functionality If I lock the the template but please note that the site has never had the template locked before as suggested and still worked fine. Anyone got any ideas please?
  20. raisondetre

    Adding Sprite Icons

    I have uploaded a simple small image (Townhall) to the 'img' folder. I have read the Wiki instructions re 'Explanation tray of sprites but do not understand this step . . . Add the image to the larger sprites image (for example, tng_icon_sprites.gif, which holds all the public menu icons). How do I add the image into that gif that holds the sprites? I think I might be missing something simple but can't figure it out.
  21. I am working on Media in 11.02, template 14. Can anyone suggest a way to show the physical location as a field name for the list rather than the geocode location? I realize one can enter the location in the description field but it would be ever so neat to have a toggle switch for that field heading - or the option to change it in the template code. An actual 'place' in that column would make more sense to most of my 'audience'. Certainly NOT a high priority but I was wondering if anyone had made that change? MSB
  22. raisondetre

    Validating Code

    This validation error is not affecting the program but I am curious. <span class='st_facebook_hcount' displayText='Facebook'></span> When I use a validation tool on a .php, this error sometimes appears. When I check the .php file that generated it, I can't find any text that matches that. I did copy and paste a test paragraph from Wiki. Could it have been embedded there? Any ideas? Not a big issue but I wondered what caused that error. Thanks!
  23. The fields "_UID" and "_Color" show under the details for individuals. Can I hide these from public view? Just makes for viewers confusion, I think.
  24. Currently using a customized version of TNG's randomphoto.php on my homepage. Of course the photos change every time the homepage is reloaded, but was wondering if anyone has developed code enabling just the section of the random photo(s) to reload and not the entire page, at a set time interval, until the user performs an action on the page. Ron
  25. I have read TNG's Wiki entry: User Pages - Getting Started: http://tng.lythgoes.net/wiki/index.php/User_Pages_-_Getting_Started I have downloaded Dave Freeman's, Creating Extra Pages for Use in TNG, from 2007: Extra_Page_Template_Procedure.doc I have Notepad++ on my desktop ready to use. I have searched the forums using several keywords and cannot find specific instructions for a very novice coder. All that and I STILL don't know where to begin because I cannot find: historytemplate.php in my public_html folder. "Histories" are there but I cannot find any php file. I am using TNG V 11.0.1 and template 12. I am using Simply Hosting and can see my directory through cpanel access. At the moment, I am feeling newer than a newbie and feel I must be missing something simple. Usually I can follow directions well but adding a new page is defying me. I would appreciate help pointing me in the right direction . . . Thanks much, Margie B.
×