WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

toplists in textareas

Version: 4.1.61
Status: completed
printPrint


toplists in textareas
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 88
Total Posts: 304
Posted 08/28/08 - 06:36 AM:
quote post
#1
Hi Paul,

If you put a toplist in the textarea of the static file generation part in the admin panel, it literally changes the domain root folder permission to 666. It does this, because at the end of a toplist, there is a blank row. Here is my toplist:

<!-- BEGIN TOPLIST 47 -->
<CONFIG>links,id,999999,ascending,,,,0,1,0,0,0,1,,1</CONFIG>listazasok/{LINKID}_HUN.html<!-- END TOPLIST 47 -->


As you can see, I already had to eliminate all spaces, so that the output doesn't contain line-breaks. However, at the end of the toplist, there are 2 things which shouldn't really be there:
1. the
<!-- END TOPLIST 47 -->

2. a blank row

Any way to get rid of them?

Thanks
David
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 08/28/08 - 08:40 AM:
quote post
#2
The static file export page has no relation whatsoever to toplists, so I'll guess you're actually talking about the javascript export page.The javascript export page asks for a toplist config line. That's one line, not two lines, not three lines. It's the line that starts with <CONFIG> and ends with </CONFIG>.

Here is my toplist:

That isn't a legal toplist since the config line has been crammed full of other stuff, leaving no other lines.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 88
Total Posts: 304
Posted 08/28/08 - 08:55 AM:
quote post
#3
Hi Paul,

This would create even more line breaks:

<!-- BEGIN TOPLIST 47 -->
<CONFIG>links,id,999999,ascending,,,,0,1,0,0,0,1,,1</CONFIG>
listazasok/{LINKID}_HUN.html
<!-- END TOPLIST 47 -->


Heck, if I put the above into an empty TPL and call it on the site without an wrapper, and look at the page source, the mentioned problems are present there as well. Granted, they don't matter, since the browser displays everything fine, but the END TOPLIST for example, is still there. See what I mean now?

I was talking about the static file generation, not the javascript export page. I am not trying to generate a toplist, but generate static pages, based on a toplist of links. So for each link I have in the toplist, I want a link specific page generated.

The static file generator DOES work for this, and does it fine, ONLY IF I remove the last blank row in the textarea after the toplist in it. I looked at the TOPLIST entries in the PHP files, but no idea which of them is responsible for creating a linebreak at the end of a toplist.

David
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 88
Total Posts: 304
Posted 08/28/08 - 10:43 AM:
quote post
#4
Never mind. smiling face This works:


<textarea name="staticexportnamelist" rows="5" cols="80">
<!-- BEGIN TOPLIST 47 --><CONFIG>links,id,999999,ascending,lastedit > {TIME} - 86400,,,0,1,0,0,0,1,,1</CONFIG>
listazasok/{LINKID}_HUN.html
listazasok/{LINKID}_ENG.html<!-- END TOPLIST 47 --></textarea>


There cannot be a line-break between the END TOPLIST and the closing textarea tag. All is good. smiling face
The reason why I wanted this: I am building a real-estate site, where each property has a TON of attributes. So to speed up the site, I generate a static html of the attributes for each property that has been edited within the last hour.

David
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 08/30/08 - 02:16 PM:
quote post
#5
I would not expect a toplist inside a <textarea> tag to work right, since it's not designed for that and is likely to leave HTML artifacts.

Edited by Paul on 08/30/08 - 02:18 PM

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 08/31/08 - 09:14 AM:
quote post
#6
Added a cleanup to allow toplists to be used in textareas.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 88
Total Posts: 304
Posted 09/05/08 - 10:26 AM:
quote post
#7
after upgrade to 5.0.3, the static file generator doesn't work again. the closing tags for the toplists are gone now, but I get this error:


Query 6: SELECT `name`,`content` FROM wsnlinks_settings WHERE type='special'

Load time so far: 0.1 seconds.

Number of rows is 15

Query 7: SELECT `name`,`content` FROM wsnlinks_settings WHERE type='special'

Load time so far: 0.1 seconds.

Number of rows is 15

Query 8: SELECT `name`,`content` FROM wsnlinks_settings WHERE type is NULL OR type != 'special'

Load time so far: 0.1 seconds.

Number of rows is 461

Query 9: SELECT `name`,`content` FROM wsnlinks_settings WHERE type='special'

Load time so far: 0.11 seconds.

Number of rows is 15

Load time so far: 0.12 seconds.

Query 10: UPDATE wsnlinks_settings SET content='http://cccc.com/index.php?custom=yes&TID=g_sidebar_searchHUN&usewrapper=no http://ccccc.com/index.php?custom=yes&TID=g_sideb... ' WHERE name='staticexporturllist'

Load time so far: 0.12 seconds.

Query 11: UPDATE wsnlinks_settings SET content='templates/multilingual/custom/sidebar_searchHUN.tpl templates/multilingual/custom/sidebar_searchENG.tpl ' WHERE name='staticexportnamelist'

An error occoured at http://ccccc.com/admin/prefs.php?section=static&f... on 2008-09-05 18:24:38. Please relay this data to support. Error #2: 'fopen(../) [function.fopen]: failed to open stream: Is a directory' in /home/cccc/public_html/cventura/includes/filefunctions.php on line 556.

An error occoured at http://ccc.com/admin/prefs.php?section=static&filled=1 on 2008-09-05 18:24:38. Please relay this data to support. Error #2: 'fwrite(): supplied argument is not a valid stream resource' in /home/ccccc/public_html/cventura/includes/filefunctions.php on line 556.

An error occoured at http://ccc.com/admin/prefs.php?section=static&filled=1 on 2008-09-05 18:24:38. Please relay this data to support. Error #2: 'fclose(): supplied argument is not a valid stream resource' in /home/ccccc/public_html/cventura/includes/filefunctions.php on line 559.

Load time so far: 0.66 seconds.

Query 12: UPDATE wsnlinks_settings SET content='../styles/default' WHERE name='stylesheet'

Load time so far: 0.66 seconds.

Query 13: UPDATE wsnlinks_settings SET content='templates/multilingual' WHERE name='templatesdir'

An error occoured at http://ccc.com/admin/prefs.php?section=static&filled=1 on 2008-09-05 18:24:38. Please relay this data to support. Error #2: 'require(adminend.php) [function.require]: failed to open stream: Permission denied' in /home/ccccc/public_html/cventura/admin/prefs.php on line 614.

An error occoured at http://ccc.com/admin/prefs.php?section=static&filled=1 on 2008-09-05 18:24:38. Please relay this data to support. Error #2: 'require(adminend.php) [function.require]: failed to open stream: Permission denied' in /home/ccccc/public_html/cventura/admin/prefs.php on line 614.
Fatal error: require() [function.require]: Failed opening required 'adminend.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ccccc/public_html/cventura/admin/prefs.php on line 614


and i get my root folder chmoded to 666 automatically for some reason.

David

Edited by david on 09/05/08 - 10:29 AM
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005
Total Topics: 88
Total Posts: 304
Posted 09/05/08 - 11:12 AM:
quote post
#8
figured it out. there cannot be a blank last row in the textareas at all in the static file generator page.
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 09/09/08 - 05:50 AM:
quote post
#9
Trimming out blank lines now.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.