• [MOD]Another Simple News Publishing Mod 5 0 5 1
Currently:  

Author Topic: [MOD]Another Simple News Publishing Mod  (Read 348794 times)

0 Members and 3 Guests are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #240 on: September 16, 2007, 04:37:56 PM »
Quote
if I want to address this field with JavaScript were should I put the script.

In admin/news.php you need add for JS code ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline MadSci

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #241 on: September 16, 2007, 05:06:55 PM »
..so if you want to have like :

<script language="javascript1.2">bla blah</script>

right under the:

<td><p><textarea name="news_text" rows="15" cols="80"></textarea></p></td>

how do  you do that.

sorry for being pain in the neck with this...the code is very confusing.. :lol:

ms

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #242 on: September 16, 2007, 05:31:26 PM »
Please post JS code ... no code - no can help.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline MadSci

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #243 on: September 16, 2007, 05:35:04 PM »
I need this code:
<script language="javascript1.2">make_wizz('textfield');</script>

to address the ID of the textfield above.

ms

I already integrated the calls to the outside sccript

ms

PD the final result should be:

<td><p><textarea name="news_text" id="news_text" rows="15" cols="80"></textarea></p></td>
<script language="javascript1.2">make_wizz('news_text');</script>

ms

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #244 on: September 16, 2007, 06:02:51 PM »
Quote
<script language="javascript1.2">make_wizz('textfield');</script>

This need go in admin/admin_global.php file ... from <head> to </head> ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline MadSci

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #245 on: September 16, 2007, 06:08:52 PM »
Thunder let me show you my entire project so you get the idea:

first look at this:  http://www.wyzz.info/demo.php

this is WYSIWYG javascript based script.

It has only one file to be included in the head and the seccond line bellow the the text array.

however I think the textarea does not support html code so Im not sure if it will work I just realized this.
It would be nice ...

what you think

ms

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #246 on: September 16, 2007, 06:24:11 PM »
Ok, so now you tawk my language.

// Step 1

Upload wyzz.js file in admin folder.

In admin/index.php file,

find:

Quote
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang['charset']; ?>">

add after:

Code: [Select]
<script language="JavaScript" type="text/javascript" src="<?php echo ROOT_PATH "admin/wyzz.js"?>"></script>

// Step 2

In admin/admin_functions.php file,

find:

Quote
global $error, $HTTP_POST_VARS, $textarea_size;

replace:

Code: [Select]
global $error, $HTTP_POST_VARS, $textarea_size, $self_url;

Find (original):

Quote
echo "<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n<td><p><textarea name=\"".$name."\" rows=\"".$rows."\" cols=\"".$cols."\">".format_text($value, 2)."</textarea></p></td>\n</tr>\n";

replace:

Code: [Select]
if (preg_match("/news\.php/", $self_url)) {
echo "<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n<td><p><textarea name=\"".$name."\" id=\"".$name."\" rows=\"".$rows."\" cols=\"".$cols."\">".format_text($value, 2)."</textarea></p></td>\n</tr>\n";
?>
<script language="javascript1.2">
    make_wyzz('<?php echo $name?>');
  </script>
<?php
} else {
echo 
"<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n<td><p><textarea name=\"".$name."\" rows=\"".$rows."\" cols=\"".$cols."\">".format_text($value2)."</textarea></p></td>\n</tr>\n";
}

Should work ...
« Last Edit: August 27, 2011, 01:50:07 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline MadSci

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #247 on: September 16, 2007, 09:54:36 PM »
no go actually no effect what so ever..I dont see the javascript code with make_wizz beeing put after the text fiels code bellow:

Code: [Select]
<script type="text/javascript" language="javascript" src="./../admin/browserSniffer.js"></script>

    <script type="text/javascript" language="javascript" src="./../admin/calendar.js"></script>
<script language="JavaScript" type="text/javascript" src="./../admin/wyzz/wyzz.js"></script>
[b]this is good however I have included that line by hand[/b]

and latter:

Code: [Select]
<tr class="tablerow2" valign="top">
<td><p class="rowtitle">Content</p></td>
<td><p><textarea name="news_text" id="news_text" rows="15" cols="80"></textarea></p></td>
</tr>

should become:

Code: [Select]
<tr class="tablerow2" valign="top">
<td><p class="rowtitle">Content</p></td>
<td><p><textarea name="news_text" id="news_text" rows="15" cols="80"></textarea></p></td>
<script language="javascript1.2">make_wizz('news_text');</script>
</tr>

Im not sure what we did upthere

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #248 on: September 16, 2007, 10:03:23 PM »
Forgot in index.php for check news file ...

Quote
<script language="javascript1.2">make_wizz('news_text');</script>

replace:

Code: [Select]
<?php
if (preg_match("/news.php/"$script_url)) {
?>

<script language="javascript1.2">make_wizz('news_text');</script>
<?php
}
?>

« Last Edit: February 18, 2011, 01:56:00 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline MadSci

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #249 on: September 16, 2007, 11:21:13 PM »
no go the script is still no there:

Code: [Select]
<tr class="tablerow">
<td><p class="rowtitle">Title</p></td>
<td><p><input type="text" size="30" name="news_title" value=""></p></td>
</tr>



so the text field will support the html code no ?

ms

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #250 on: September 17, 2007, 01:22:02 AM »
Sorry ... I no use this JS code ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD]Another Simple News Publishing Mod
« Reply #251 on: September 22, 2007, 04:30:09 AM »
Is it possible to ask a news item at once by knowing his id like the thumbnails does. This wil ask a link like "details.php?image_id=xx".
A link like news.php?news_id=xx shows the whole page.

yes it is.. i have made it now in my site: http://www.myart.es

in news.php
search:
Code: [Select]
$sql = "SELECT news_id, news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM ".NEWS_TABLE." news, 4images_users users WHERE users.user_id = news.user_id ORDER BY news_date DESC LIMIT $offset, $newsPerPage";
replace to:
Code: [Select]
if($news_id=="")
$sql = "SELECT news_id, news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM ".NEWS_TABLE." news, 4images_users users WHERE users.user_id = news.user_id ORDER BY news_date DESC LIMIT $offset, $newsPerPage";
else
  $sql = "SELECT news_id, news_title, news_text, news.user_name, news_date, news.user_id, users.userpic FROM ".NEWS_TABLE." news, 4images_users users WHERE users.user_id = news.user_id AND news_id = ".$news_id." ORDER BY news_date DESC LIMIT $offset, $newsPerPage";
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #252 on: September 22, 2007, 05:06:53 AM »
And change:

Quote
4images_users

to:

Code: [Select]
" . USERS_TABLE . "

in code. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Koosje

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #253 on: September 22, 2007, 11:48:41 PM »
Thanks for the information. But when i've changed the two tips, mentioned above i've got an unexpected error, and the news pages are empty.................

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD]Another Simple News Publishing Mod
« Reply #254 on: September 23, 2007, 01:03:05 AM »
Please read step 6 of my signature. What is say / do for unexpected error message ? What is exact error text ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?