last day (514 days later) » 

8:08 PM
-1
A: how to append a class id to https target

rauwittYou have to make changes in index.php and main.js. In index.php you insert the new classes "recrent" and "strongest" for the hyperlink tags: ... <div class="row"> <div class="span12 time_since invisible"> <center><span class="hours"></span> hours <span class="minutes"></span> minutes <spa...

 
Tim
how would i use it in the following to get the publicid to show from the xml- <div class="span6 recent_quake invisible"> <h3>Latest Quake: <span class="publicid"></span><span class="magnitude"></span>M - <span class="depth"></span> @ <span class="origintime"></span> </h3> </div>
i thought maybe something like $publicid = "<span class='publicid'></span>";
<div class="span6 recent_quake invisible"> <h3>Latest Quake: <span class="magnitude"></span>M - <span class="depth"></span> @ <span class="origintime"></span> <span class="publicid"><?php print "<a href='geonet.org.nz/earthquake/…>"; ?></span>
as i dont do code i am unable to explain properly sorry for this
nzquakes.online/leqnz is the site where it says PublicId i need that text next to it to be able to click and goto that earthquake i can supply code if needed to help what i need
it gets data from geonet.org.nz/quakes/services/all.json and processed but i cant figure out how to get the publicid part to show as a clickable link not just show text of that class
<div class="span6 recent_quake invisible"> <h3>Latest Quake:<br> Magnitude: <span class="magnitude"></span> <br>Depth: <span class="depth"></span> <br> Time: <span class="origintime"></span> <br>PublicID: <span class="publicid"></span> </h3> </div>
specifically this part i need help with PublicID: <span class="publicid"></span> as this is the part that displays the publicid but how to make it clickable link ??
it is probably very easy but i don't code so to me is impossible at the moment
if you goto that page i would ultimately like all the 20 that show on map to be clickable and goto that earthquake but not sure if possible
<div class="span6 recent_quake invisible"> <h3>Latest Quake:<br> Magnitude: <span class="magnitude"></span> <br>Depth: <span class="depth"></span> <br> Time: <span class="origintime"></span> <br>PublicID: <a href="geonet.org.nz/earthquake '.publicid.'"><span class="publicid"></span></a> </h3>
i got close with that
i guess its not possible or you guys don't know how??
 
Please supply the source code of nzquakes.online/leqnz beginning with the body tag. You may find it in the file "index.php".
 
Tim
code too long by 667 please goto that page and right click and view source as i cant put on here to long
<body> <div class="container"> <div class="page-header"> <center><h1>Real Time Latest 20 Earth Quakes - New Zealand</h1></center> </div> <div class="row"> <div class="span12 time_since invisible"> <center><span class="hours"></span> hours <span class="minutes"></span> minutes <span class="seconds"></span> seconds since last earth quake
</div></center> <div class="span6 recent_quake invisible"> <h3>Live - Latest Quake<br> Magnitude: <span class="magnitude"></span> <br>Depth: <span class="depth"></span> <br> Time: <span class="origintime"></span> NZDT 24hr <br>PublicID: <a href="geonet.org.nz/earthquake/unnoticeable" target="_blank"><span class="publicid"></span></a> </h3> </div>
<div class="span6 strongest_quake"> <h3>Strongest Quake Last 24 Hours<br> Magnitude: <span class="magnitude"></span> <br>Depth: <span class="depth"></span> <br> Time: <span class="origintime"></span> NZDT 24hr <br>PublicID: <a href="geonet.org.nz/earthquake/unnoticeable" target="_blank"><span class="publicid"></span></a> </h3> </div> </div> <div id="map"></div> </div> <br> </body>
Thank you in advance if you can help me
$('.publicid', '.recent_quake').html(thisQuake.properties.publicid); <-- this is the code from the .js file i think it calls to get that part maybe ?
i put the whole contents up at nzquakes.online/leqnz/leqnz.rar
as i suspect you will need more than the index.php contents possibly
any luck yet boss
 
I edited the answer. You can insert the javascript code snippet in your "index.php" file.
 
Tim
i am unsure where to put as put where should go but does nothing apart from put map at top publicid number still no goto the event
<div class="span6 recent_quake invisible"> <h3>Live - Latest Quake<br> Magnitude: <span class="magnitude"></span> <br>Depth: <span class="depth"></span> <br> Time: <span class="origintime"></span> NZDT 24hr <br>PublicID: <a href="geonet.org.nz/earthquake" target="_blank"><span class="publicid"></span></a> </h3> </div> above is the code where it displays the publicid that is the part i need the span class="publicid" ????
 
8:08 PM
After line 97 of index.php you have to insert the new javascript part beginning with <script> and ending with </script>.
 
Tim
yes i have it there but does still not goto the publicid event at geonet still goes to earthquake page what am i missing lol again thank you
i will just give up thank you anyways as i cant code i have no clue where or what to put
 
You inserted the javascript part after the body tag but you should insert it before the line: <div id="map"></div>
 
Tim
<script> var recent = $('.publicid', '.recent_quake').html(); var strongest = $('.publicid', '.strongest_quake').html(); $('a:first').attr("href", "geonet.org.nz/earthquake/"+ recent); $('a:last').attr("href", "geonet.org.nz/earthquake/"+ strongest); </script> <div id="map"></div> is what i have then the closing </body>
when i right click view source it starts line 73
maybe this part is wrong - PublicID: <a href="geonet.org.nz/earthquake" target="_blank"><span class="publicid"></span></a>
 
I transfered the javascript code to the head of index.php. Please notice the changed answer above. Now the javascript code is before <!-- Stylesheets -->. The former javascript section can be deleted.
 
Tim
no work still do i need to replace <a href="geonet.org.nz/earthquake" target="_blank"><span class="publicid"></span></a> with something else
as when click the public id number it goes to geonet.org.nz/earthquake
where it should goto say geonet.org.nz/earthquake/2022p947548
 
8:08 PM
I have made changes in index.php and main.js in the answer above. The former javascript snippet in index.php can be deleted.
 
 
3 hours later…
Tim
10:55 PM
Thank you so so much boss seems when i copied and pasted the index.php part it didnt do something as went all whacky looking so i just manually typed out the new span part and worked as it should maybe it added a extra char when copied ?? you are very much a life save my friend this been nagging me for like ages as this was my old script that someone stole and replaced a lot of stuff
would it be easy to get it to be able click any event on map and goto that to or is a lot more code? also map went a lil smaller and i dont no where to change it as i havnt touched anything but what was needed in the main.js
 
Tim
11:35 PM
the script i made was from my old site nzquakes.maori.nz some dude from Github stole it and replaced alot of stuff in the index and .js files as it use to also list the place name it occured but is now also gone
 

  last day (514 days later) »