Removing Table Tags from Random image Removing Table Tags from Random image
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Removing Table Tags from Random image

Started by Alaska, June 26, 2007, 02:36:11 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Alaska

Using CMPfetch v 2.0.0.  Looked at dao.php but thought it best to ask what is the best way to remove all of the table tags from the generated random image.  The image tags are OK. 

The plan is to wrap text around the image using CSS in a non table CSS site. 

Sample test page is:  http://paragondesignak.com/pictures/index.php

Thanks,

Jim

vuud

Quote from: Alaska on June 26, 2007, 02:36:11 AM
Using CMPfetch v 2.0.0.  Looked at dao.php but thought it best to ask what is the best way to remove all of the table tags from the generated random image.  The image tags are OK. 

The plan is to wrap text around the image using CSS in a non table CSS site. 

Sample test page is:  http://paragondesignak.com/pictures/index.php

Thanks,

Jim


Your best bet, and way more recommended than screwing with the code, would be to set the Return type to resultset and just grab the image information out and form your own tag.

By changing the returntype you can get back an array where each row is a ton of information on the photo.



Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Alaska

Thanks for the hint, but my level of PHP is at the experimental level.  Was looking for the table tags to remove them from the code.  Maybe messy, but simple.  But they sure seem to be hidden.

Thanks again for the suggestion.......

Jim

vuud

Quote from: Alaska on June 26, 2007, 10:33:10 AM
Thanks for the hint, but my level of PHP is at the experimental level.  Was looking for the table tags to remove them from the code.  Maybe messy, but simple.  But they sure seem to be hidden.

Thanks again for the suggestion.......

Jim

The amount of PHP experience needed to follow my suggestion is LESS than what should be required to go in and start making code changes.  However, if you can get into the cpmfetch code and successfully remove the table code, you definitely can go back and do it the right way.

Remove the table tags is not going to be easy, and I so highly recommend against it - once you change the code you are into unsupported land.

Good luck though

Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

balafre

Hi,
in fact I'd like to be able to remove the tables too.
I'll try and let you know if I succeed.

balafre

Here is a quick and dirty way to do that (there must be a smarter way...),
NOTE : AS VUUD TOLD YOU ARE INTO UNSUPPORTED LAND
1. Make a backup of your cpmfetch.php first
2. Then find these functions in cpmfetch.php :
function htmlTagTABLE($extraAttributes="") {



$htmlOut = '<table ';

if (array_key_exists('tablestyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['tablestyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= " " . $this->getOptionAttributes("tableattributes");

$htmlOut .= '>' . "\n";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTABLE_END() { return "</table>\n"; }





/**

*

* @access private

*/

function htmlTagTR($extraAttributes="") {

$htmlOut = '<tr';

if (array_key_exists('rowstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['rowstyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= $this->getOptionAttributes("rowattributes");

$htmlOut .= '>' . "\n";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTR_END() { return "</tr>\n"; }





/**

*

* @access private

*/

function htmlTagTH($contents,$extraAttributes="") {

$htmlOut = '<th';

if (array_key_exists('tableheadstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['tableheadstyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= $this->getOptionAttributes("rowheaderattributes");

$htmlOut .= '>' . $contents . '</th>' . "\n";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTD($contents, $extraAttributes="") {

$htmlOut = '<td';

if (array_key_exists('cellstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['cellstyle']}";

if ($extraAttributes != "") $htmlOut .= " " . $extraAttributes;

$htmlOut .= $this->getOptionAttributes("cellattributes");

$htmlOut .= '>' . $contents . '</td>' . "\n";

return $htmlOut;

}



and replace them by :
function htmlTagTABLE($extraAttributes="") {



$htmlOut = '';

if (array_key_exists('tablestyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['tablestyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= " " . $this->getOptionAttributes("tableattributes");

$htmlOut .= '' . "";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTABLE_END() { return ""; }





/**

*

* @access private

*/

function htmlTagTR($extraAttributes="") {

$htmlOut = '';

if (array_key_exists('rowstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['rowstyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= $this->getOptionAttributes("rowattributes");

$htmlOut .= '' . "";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTR_END() { return ""; }





/**

*

* @access private

*/

function htmlTagTH($contents,$extraAttributes="") {

$htmlOut = '';

if (array_key_exists('tableheadstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['tableheadstyle']}";

if ($extraAttributes != "") $htmlOut .= " $extraAttributes";

$htmlOut .= $this->getOptionAttributes("rowheaderattributes");

$htmlOut .= '' . $contents . '' . "";

return $htmlOut;

}



/**

*

* @access private

*/

function htmlTagTD($contents, $extraAttributes="") {

$htmlOut = '';

if (array_key_exists('cellstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['cellstyle']}";

if ($extraAttributes != "") $htmlOut .= " " . $extraAttributes;

$htmlOut .= $this->getOptionAttributes("cellattributes");

$htmlOut .= '' . $contents . '' . "";

return $htmlOut;

}