|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
e8 B. M) S3 z' R8 A( q7 u// Theme Option
2 J' Q% W, M& o$ X////////////////////////////////////////////////////////////////////////////////
$ l) u0 h2 c. b( Q$ }) p! c8 x0 ]8 H9 Z( q9 \
$themename = "Zenx";6 r! _! F, C% O) U0 \. A4 f& H
$shortname = str_replace(' ', '_', strtolower($themename));# q. Q4 ~: X a3 _5 f
) M% Z) G; d7 y7 ~
function get_theme_option($option)
- g9 L) Z# J: O0 H{! R% x- v8 m) h# W$ _" u: I9 x; q
global $shortname;# Z# g. K1 ^$ m
return stripslashes(get_option($shortname . '_' . $option));& ^6 N9 h4 v# N6 ~9 c; l
}
% B" k# ?. w _. u
' ~( T, J# P) f$ xfunction get_theme_settings($option)& A7 D T* B* b1 q9 j- S
{
# l" l5 B' ^# ~3 v8 h2 h& H, n. m return stripslashes(get_option($option));
) f g ]3 G \- A X4 y}
1 ^6 O& `: j: s w8 ]+ U2 c$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");, U9 I7 `% U. }) i" p5 v
$wp_getcat = array();
' A* ]9 m# ?9 zforeach ($wp_dropdown_rd_admin as $category_list) {6 Z4 t8 ~' v: ?% n0 i* A" q
$wp_getcat[$category_list->term_id] = $category_list->name;
8 r' {, m$ }( X) w+ {. m6 L( e, S; r+ k}, \: g% n. Z2 `
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");1 X9 S" n' U# n
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
+ b8 F$ x: t3 I1 m+ [9 L, l7 ^$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
. R& n7 e+ h, m9 K# [/ {4 _6 n
( L$ l3 R! [5 K$options = array (8 {# `" ~# ~8 |6 `2 q& W
7 ~& V( l8 n9 O- b3 P# v
9 ^- ~, N! A K! F array( "name" => "Blog Header Settings",2 R' K% R' f" G \
"type" => "heading",- t1 j: V. {, t- D! W" N
),
3 B5 O+ Q% h& A* c. X" g
2 K* K: Y+ ~% g: g& I; Y6 G/ N' E array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>", A) n0 }/ Z# K- q# W
"id" => $shortname."_header_logo_activate",; H" O) h# W% N( u: x- l
"type" => "select",( Q9 d) M; p- E6 @1 v
"std" => "No",
( p7 f9 v: m) X; W/ l/ X* f2 h, c, C" d6 H "options" => array("No", "Yes")),
7 S' g: |4 @' |. k6 H* E/ q
5 q, l; ]6 N: X* Y, V+ G k% Y/ x array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",( k2 f# v, ~+ M4 _, c6 M
"id" => $shortname."_logo_url",
# V* j9 z: _, ]) q* A4 r* p5 J% W "type" => "text",
8 O5 }9 s: `% Y2 r$ ]! H) n8 B+ s "box" => "social",! m K2 x, @% E9 l% p2 i
"std" => "",; M: w* ^3 E D& U. `# I3 j
),& @7 \- Q9 F- F0 J& M' K
, ?1 c$ O% D- {' \4 p2 k( ` array( "name" => "Insert Header Banner HTML Code (Header)
t( L) S; b) H- R+ ? <br /><em>*Recommended Size 468 x 60</em>
! n- ^$ Q/ n6 S" L <br /><em>*leave blank if not use</em>",5 c: V$ o5 s! s: G
"id" => $shortname."_header_banner",
: J+ ^' P5 ]: [- { "type" => "textarea",0 S6 U6 h, F6 k2 U9 C0 f4 x7 D
"std" => "",& K( `4 H% ?3 O, ] ]( T
),
6 P1 X2 N4 s7 U+ w% |1 M7 \% v: u- o
array( "name" => "</div></div>",, p8 i& ]( z4 x' a/ i. ]
"type" => "close",
) \& M* x3 ~( Q7 @7 Y0 f3 F' Z ),
/ D5 [ Y. h+ @+ S7 a1 K3 }) q" E1 s; B& R7 W" f4 b& U
8 i. H2 E1 V6 i5 g! W6 }
array( "name" => "Header Navigation Settings",
% H- a8 d% L t, l ? "type" => "heading",! I' v' F: m( [# t
),) p# F# B$ I N+ g& [$ `
* q3 \. V5 r/ w) J- H array( "name" => "Insert Page ID To Exclude On Header Navigation<br />3 l; B, \$ S$ X3 m# A' d
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
* S! Y9 Q7 p! L9 R( M6 B <em>*Enter the page post ID number only</em><br />3 ? ?% u. e m
<em>*separate by comma</em><br />' I5 l$ m7 K9 z3 A' s' C+ b
<em>*Exclude pages which you don't want to show on the header navigation</em>",
% N7 k4 a f. O8 i! R5 _3 W) l "id" => $shortname."_header_page_navigation",
! g A8 ? u/ t$ P# H "type" => "text",
; [2 k+ `8 ]7 F5 E7 E, b# s "std" => "",
/ u8 V5 ~ q @, B ),
) ~7 j- l/ h* t) l8 j7 ]$ `) o" F7 x# A2 x
array( "name" => "</div></div>", E# h- t% A2 }5 I3 @& E
"type" => "close",7 _. ]- g2 h; q e$ {$ N$ }
),
/ u6 v1 o% X! y; K7 M3 E2 C
- h9 @8 y* R5 O8 D2 S/ T7 U9 O) q
array( "name" => "Post Auto Thumbnails Settings",
6 t, c4 e- s, c; X/ V "type" => "heading",# }; E( j; f4 o. V7 r" R( u& ~
),3 E- E0 \; q% g- V$ Z" M
. n1 J; Y2 c3 `3 ~9 P- {; I
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",- J" t$ E3 w8 ^( r- H2 T. k, a
"id" => $shortname."_timthumb_activate",
0 x8 V( v) X+ I4 H "type" => "select",/ k. n" z! M% a( s& g9 o- U* z0 ~
"std" => "No",
1 A* h! j' w# D/ O "options" => array("No", "Yes")),* {$ d( ~5 k) { S
0 ^2 M% E. P9 E! j! ~6 X array( "name" => "If Timthumb is enabled, Please choose its cropping method",* `, z8 l" x+ Q
"id" => $shortname."_timthumb_cropping",
3 a1 w: K2 Z: b& f2 r "type" => "select",# q: E' K, R% h$ n( b
"std" => "",$ f9 Z& E) G7 @0 b) q
"options" => $crop_position),* i$ y2 v! X7 y
9 I* U% a3 D6 z, B2 V& i$ Q array( "name" => "Insert Width Of Thumbnail Image<br />
/ A% \+ m4 F+ |$ Q2 M3 Y; L <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />8 y2 H- R8 x* Z2 U
<em>*Leave Blank To Use Default: 250</em><br />",/ d3 A; k- X, } {2 R6 a
"id" => $shortname."_thumb_width",& y R ~& L5 T
"type" => "text",* N4 F) C1 N2 I' b ] }$ r' N
"std" => "",8 O1 ~2 L# ~8 X
),* P6 A- m9 R ?: i
+ [8 u5 d( d4 s7 T& X' @
array( "name" => "Insert Height Of Thumbnail Image<br />0 T& l1 b2 U9 l7 f- ] w6 R# z Z. S
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />! B+ x0 Q9 n6 S; J6 T) ]
<em>*Leave Blank To Use Default: 200</em><br />",
2 Y! A9 V: v$ E4 a: x) [6 L" ` "id" => $shortname."_thumb_height",& Y6 s- Q, M; d4 C2 F& T' n
"type" => "text",
/ i% O4 X: m! f% H "std" => "",' F1 N9 z' d( y/ R! Y: e
),$ `4 A* ]+ m) V& a c3 i) N' v
: V; k5 C; m' g% c! } z array( "name" => "</div></div>",6 J! E2 r/ M! @) b
"type" => "close",
# R, n' { o! R ),9 i0 u- ^1 V& ~# b2 u4 r
! D7 w: m1 S& O: w# K array( "name" => "Featured Content Slider Settings",0 E* y5 G0 H, P5 Q% m
"type" => "heading",
7 S; E2 M+ D7 U7 F) G* X ),
/ n% C( B: K. A& f* t. C3 O& s, Z% A# K* ^% L! J! Q" Q6 \3 D
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
H6 k6 j" L7 |0 p "id" => $shortname."_featured_activate",
- I4 k1 Y) f% {5 D/ t) x& b "type" => "select",3 q/ j6 u+ [- [- v
"std" => "No",5 v# D" Z' }, j4 H, w
"options" => array("No", "Yes")),
: X I; _ m1 k3 ~! e2 v+ [/ d- Z$ c% b9 m% W$ [
5 \" M2 i9 @$ b- k& w
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",( L6 U4 m0 y* o4 P, `$ Z
"id" => $shortname."_featured_category",# w2 T* q7 n6 s- U8 W$ E2 M1 D
"type" => "select",* R; N! E8 }5 O/ F6 w# ?: s/ v
"std" => "Choose a category:",
. k6 m/ Q. j: C9 [5 d: B "options" => $wp_getcat),
. n9 X2 F; ]& z k& ` O& l, k o \. o) y! D }
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",' R1 B' w' ?/ \6 o ?1 a2 O5 G
"id" => $shortname."_featured_number",
0 @$ v0 ^6 G. S! ?2 E+ W "type" => "select",
& i( p6 j9 R8 |: i' D "std" => "Number of post:",' b% K6 l; \! V, f
"options" => $number_entries),/ b/ H6 ^8 Z! w; [: d
( O4 n, Y7 q0 w3 z+ p* Z3 k
array( "name" => "</div></div>",
, A3 ~# a4 o) N2 Q "type" => "close",
) X! y" n% L8 X8 X, ? ),6 T3 ~9 O. o8 y# ]+ q5 O* \8 V
& [7 R/ S1 @' }2 Z, y6 R& k0 `5 X) K0 Y
array( "name" => "Featured Category Settings",4 p2 k A1 @! V7 L2 L5 r5 F# M1 C
"type" => "heading",
, `. H0 ?8 S8 _) V ),' @7 F1 J2 f6 g: |+ c/ v
4 v! t5 X9 l6 u9 e* U array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",; e: f* b1 C. Y& B# Q
"id" => $shortname."_featured_category_activate", Y! \8 h: e9 V, y& U2 c: ^# F
"type" => "select",
- c% |8 s* ?% m# t* T& {- g "std" => "No",
7 P, n: b+ A! C" N' X "options" => array("No", "Yes")),
$ z1 Y$ G" k" s+ q* _+ h L
' b, k+ D. @; J+ _ array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",( L t8 ^% i! P
"id" => $shortname."_featured_category_id1",+ D/ c: L% J$ p9 v) | I
"type" => "select",0 a6 k9 U) B0 K# z0 L. Z9 F4 D
"std" => "Choose a category:",) w+ X5 C" }' o1 U/ i& ]1 B+ p% M
"options" => $wp_getcat),
" q7 ]! o! E/ T) K/ M ' S, B5 S# A& q: \& b
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",7 d$ T3 F* \; {' g# g. m7 S
"id" => $shortname."_featured_number1",5 H9 [/ y$ B2 B6 k Q* @
"type" => "select",
- n# j9 K; R8 u. m. b& N% K "std" => "Number of post:",/ A( t, W9 x0 K
"options" => $number_entries),* i) `1 Z2 @9 N2 t* u; I
5 J* V0 _6 X5 \* E! C
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",1 s/ n {7 h, B& D% b
"id" => $shortname."_featured_category_id2",
: B! ^) F0 v) k9 Z6 u) e2 j "type" => "select",
$ ?( w# v. u5 W* S3 V# k "std" => "Choose a category:",1 [' s3 T! e8 S
"options" => $wp_getcat),
7 A7 [7 D& @ J3 ?' A7 v9 T. E
+ t) l9 [: i' F2 C6 ]% {1 l array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
/ Z5 B# ^2 F" b6 S6 C7 D% ?5 Z "id" => $shortname."_featured_number2",
) @. d* _ `! G# I( ^ "type" => "select", }2 Z( U& J3 b5 G+ u# s( R) T8 z
"std" => "Number of post:",
' }3 l0 i |0 r7 f; k9 R "options" => $number_entries),$ X: }6 C$ h1 o4 K& l0 k6 n
0 f2 T' V O* a/ t + l9 R7 M8 P9 N6 K3 L; z$ k% U
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",0 w' o: r# @% s, e1 \
"id" => $shortname."_featured_category_id3",
$ D9 b3 p/ k2 T, ?6 q* | "type" => "select",' W P- t4 _7 o
"std" => "Choose a category:",
; j* q# q0 {0 ]6 N. g) x- W "options" => $wp_getcat),$ J5 Q. P1 v7 p _! i% q1 o: S; n$ r! r
' m$ n- j* o: r% Z5 }3 e array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
% v* m( D* F' Z "id" => $shortname."_featured_number3",
4 q) A8 O' o6 Q( \; E- D "type" => "select",6 x: t4 h' ^" }
"std" => "Number of post:",5 m/ `: i* o' {( e
"options" => $number_entries),
/ l- `9 S, a% o# ?1 a. \
. ]; t) [$ T; V, Q. u: p, \' K9 L/ B6 O' R' f; U* ^' ?
array( "name" => "</div></div>",
8 a6 E2 T9 F6 ]! w- N0 |+ h3 Y "type" => "close",
" d; D5 x# b5 O% O* Y! N+ ]9 W, K ),+ |+ U8 r6 D5 A; e& [8 [" x
! h, `# C# @3 B; B8 M, A D
y+ N& K0 W6 n* M3 }6 x$ | array( "name" => "Google Adsense & Analytics Settings",
+ R7 p3 p- X. W4 L, C6 U$ E. @ "type" => "heading",. I; h0 w+ y9 n, X
),& a- F2 E2 z; a# A) G7 U
+ i8 }; l/ l6 e4 z0 ? array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",' d4 ~5 w7 U. C6 ^) D
"id" => $shortname."_adsense_loop_activate",
; @9 [( V/ @8 r. P2 v, E, |; x "type" => "select",5 r% Z4 Z) g( g; C/ y2 A9 ? B
"std" => "Disable",+ S0 p/ A6 R( f0 _
"options" => array("Disable", "Enable")),
, A% ^- n- y; R' C; g+ F5 V @4 h) r* D( b, R" E
array( "name" => "Insert Google Adsense Code For Loops Here<br />
/ d$ S i- _- m. N# U) ? <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
5 u% s8 p! v# n- ^ "id" => $shortname."_adsense_loop",1 m/ h8 ~, c0 i# ]" N3 }
"type" => "textarea",
: V5 w7 D$ |& D9 N: E+ _ "std" => "",
2 O, u* I( ?" J, v! W9 v& H3 U ),3 I) w+ U s+ {/ H# }6 J- W' y2 D
5 e& f5 D/ y8 M/ L1 F" ` array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",+ F( j; H7 t9 r& \! n
"id" => $shortname."_adsense_single_activate",
( D7 C: ?, R) ]% S, y; b "type" => "select",+ [2 f5 M) {5 y' w/ O* d2 }% i1 G
"std" => "Disable",
% U5 L" `" \ ^ "options" => array("Disable", "Enable")),
2 S3 G+ T8 K* q' H, b
9 j/ q, ^! r; J. { array( "name" => "Insert Google Adsense Code For Single Page Here<br />, S, p9 z% ^' O
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",0 F4 R) n) ?, Y" f9 p2 N4 E1 j! i
"id" => $shortname."_adsense_single",: M0 t; q( m; i b6 z- }
"type" => "textarea",
Y& u' p4 H1 X/ p. |" t( U7 p "std" => "",. I, F: ~5 C# }" Q( W r( o" v5 M
),* @4 L& d+ e: r8 O0 V4 p% S
! b) Q( O" g( N) e+ G% v9 D+ e6 j8 I: N5 x# a
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
8 n8 m- S9 l, H9 j+ F( H "id" => $shortname."_google_analytics",# q3 W3 l# C' H2 v. ~7 c+ {# C
"type" => "textarea",4 ]+ C% o: D/ ~
"std" => "",( t1 `! d: @# h" r! }) J. E: Z0 n
),
0 H; h0 G+ ?3 v% u% J, d5 s7 ]' B9 w1 `2 W p6 d1 a
array( "name" => "</div></div>",
j* G0 U a8 K1 p4 R' \ "type" => "close",4 f3 G. E+ h3 z, I$ u6 F
),
+ [: l1 T/ X+ \* I' N4 [2 P , E4 u; U7 I2 Z8 V$ V- e
1 A( _* t7 U8 B" _/ w% f array( "name" => "AddThis Social Bookmarking Settings",
0 r, {& Q# n2 W4 n "type" => "heading",3 W Z& E3 d' s2 w) q, O: q
),
1 s) p, s3 e# }" A+ n8 \
# L3 f# u6 | C u4 p6 T; ^ array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
' l# T, c- b( i- V <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
' E; U0 i2 F2 I "id" => $shortname."_addthis",. }9 m# e6 B8 h: I1 k3 X+ C& c+ L
"type" => "text",4 C# f$ r3 l6 E- s4 u
"box" => "social",
0 T `" M: E) c; F "std" => "",
6 T3 I% @2 O+ s1 ?: Z ),
& e* R' j4 |& b$ k! Z) Y' |$ `6 v" i2 N: o: ]1 v) U, Q
array( "name" => "</div></div>",
5 Y1 x7 V( Z0 O7 H$ ? "type" => "close",! Q2 \% b( Y. u) a: v& X3 W m- p0 `
),1 o( X" h- f% ]4 B! ^# K- A2 U
5 F" R0 v$ W# S
0 v3 r; M) l* x; j2 x
3 L: J6 q6 k& m' D5 H7 N array( "name" => "YouTube Video Settings",- @) _/ W$ Z q' E3 p7 y
"type" => "heading",
# { h9 B$ z$ T5 K8 L8 N& X; p( b6 H ),6 X. o4 B; q5 Q
+ W H, O; Z# s' o: C$ k4 ?
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
4 \. C/ T0 ^) v! ^ "id" => $shortname."_emvideo_activate",7 T' D+ j/ Z+ v& w. H) [- c# u& `2 w
"type" => "select",7 M" F0 u$ e$ J$ E
"std" => "No",; |' V/ }5 l/ \: B6 R
"options" => array("No", "Yes")),
5 @6 r/ j6 _$ e0 m5 E# \ h* V0 X! }! f, W5 @) P$ a! \
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
7 c ^! A- i4 K2 K4 \( K "id" => $shortname."_emvideo",- {. o. j% p/ `, R1 o) T5 W
"std" => "",! b$ O! [9 g9 m4 z$ p B. r( D5 |
"type" => "text"),
! S& J3 `, w& Q/ g, T: e& ]$ h. m6 i
, s7 x& b9 v5 f7 `) P array( "name" => "</div></div>",! J$ v# W& n% B1 |' U$ J; d" W2 A
"type" => "close",
( d( l+ G7 B' x% U, u/ d$ e ),
6 O% L! ~( k& {8 p, x- I' a 6 V9 q/ o0 s4 D( n r/ \
array( "name" => "Twitter Settings",* M4 g' B! t' N/ Z- Q, ]
"type" => "heading",' i# m7 w# `) T8 B! s
),( V" k/ D |" T
( I' p# v6 q2 W
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",* L* E! A- h+ w+ ~0 I6 Z1 r# c$ \
"id" => $shortname."_twitter_activate",
* }2 c% c7 @# }+ G "type" => "select",) b$ I3 b& X0 i4 b
"std" => "No",
" u! q: g; H6 [1 m6 E. D5 B5 A9 Y& r "options" => array("No", "Yes")),
6 M: _8 N7 _. a; `+ E* F9 x/ J$ c# r" P7 a# s* Y
array( "name" => "Insert Your Twitter ID here8 [: @* @( o4 A
<br /><em>*leave blank if not necessary</em>
# ^& L6 r4 |. p# k <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
( W0 b6 [: I" L: e$ P "id" => $shortname."_twitter",
2 h6 V; F" z5 i' A1 p+ P "type" => "text",# E" ?( q( f0 V' ?& K
"box" => "social",6 s* C) R" C) ]) f; J
"std" => "",0 H" M% \/ E. s) P; L! q) ], R
),
1 I6 {, O, N: p2 @' y
[( k2 v3 h! v array( "name" => "Enter Twitter Feed Count here7 ?& `3 f, Z5 ]9 Y; T
<br /><em>*leave blank if not necessary</em>) a" V0 V% W6 M
<br /><em>*Enter How Many Twitter Feed To Display</em>",
( n% c# x2 ]% | "id" => $shortname."_twitter_count",
$ P) X5 Y1 P w: W% q/ r "type" => "text",* E7 s0 @! W& h) X6 l
"box" => "social",
v# e8 d. {8 [, Q8 Y" J "std" => "",3 b: M6 c3 L U) O
),
$ t4 \8 L% S) x& p
( U0 u3 _ L0 `5 q2 @ U array( "name" => "</div></div>",* A' |. e* O- g
"type" => "close",, m' V& g6 G+ r8 I: q% F- W8 w
),
2 L; y: e. p9 w 6 Q4 N- r% W" {( Y9 m4 M, ?
' P3 S6 h, Q! e, O. e
array( "name" => "125 x 125 Banners Advertisement Settings",
L" Y; v& b' u0 x8 E$ G "type" => "heading",
6 j& l9 u. J# L; y3 {% Z ),& c8 v2 `+ `0 Q A- X4 I
* m: |% L& x9 _$ [6 n
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) V. ?) W- P9 f "id" => $shortname."_sponsor_activate",( q( Q- A$ j$ H! _9 j8 h& g" r1 Z6 U
"type" => "select",
/ V$ ^7 F+ W; f" I2 ]/ Y# C "std" => "No",
% M: Y7 X$ `" i+ m4 \ "options" => array("No", "Yes")),' `; d/ Q+ |! H9 [9 m4 g0 Q
3 b, W5 Y" O9 X: r
9 k' u0 K8 \5 \( O array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
! [, A0 S2 b$ C. ]% y "id" => $shortname."_sponsor_banner_one",
% [" I- h# k" V- K$ | "type" => "textarea",
1 h6 ^2 y8 z; U$ j, A H! ]- h "std" => "",& J" v4 @( u( I% j9 s5 w o, N
),
5 z9 W" }6 \/ ]7 J4 p
# Y' }) G5 C: w K0 d5 P! g array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",4 y# s7 ]' F2 l' @. t! G5 P5 `
"id" => $shortname."_sponsor_banner_two",8 h0 K1 r/ T9 ~$ W5 ], ?) N
"type" => "textarea",7 ^, R3 S5 z; D7 B ]
"std" => "",
, G4 |+ {- C i$ l, {& C ),
6 W+ b+ P9 i( m' h- W( y0 N! D v @
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",$ I+ E, ?4 f/ X* k! Z* S& j
"id" => $shortname."_sponsor_banner_three",
5 F, l3 @# l/ E3 a' A* @# H "type" => "textarea",
K4 @3 I, w2 Y; z v3 @" y4 l "std" => "",1 t3 Y3 ?) y g) W% p
),
* Z* _0 b2 S( e: Z" e! w- J
2 ^( s2 j+ J6 ^- a9 p array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
+ z) }; e9 q8 b, I- I "id" => $shortname."_sponsor_banner_four",
) b, L T/ w% s4 K3 }9 t "type" => "textarea",8 l/ Z- }3 p3 m7 l
"std" => "",
* | x, s& E! |, ^9 A ),
+ J, B& r$ r) @7 _
; j2 _- O8 f; a. C- ]( t array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
& x0 |- \8 m: p, J "id" => $shortname."_sponsor_banner_five",
& r; P8 P7 z' x, u' V! {3 B' X5 u "type" => "textarea",$ u& {$ g6 }1 I- l
"std" => "",5 r) d; j+ W) `3 m) N7 p. z& [
),
! ]# e2 ?- T1 J5 _+ g3 l4 [/ N
% \6 S p* M1 X: T; @7 w1 n array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",2 t' ?! C& ^5 L3 Y* T
"id" => $shortname."_sponsor_banner_six",
% I5 \4 [9 i0 W "type" => "textarea",
1 X7 d3 Z, X4 q* N2 y "std" => "",
8 J9 l! s( ?- t7 m: C ),
! @2 S9 x& `3 i/ H, U, T3 c+ i( G" r* z0 L2 a; Z# Z
array( "name" => "</div></div>",1 ]% c }, q& y; S
"type" => "close",9 l; |/ p) e; a% F
),
$ U- X7 t+ s) p* t8 {6 u% H/ e. Q" C4 |! x2 k
{- P& E7 u8 a% p
, E, f7 D2 t, ?6 D1 ]2 l);
5 ]. u3 F8 I5 O! H# O* k) Y# T. G# q' Q
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {' g5 r# K2 ?1 c& }- W
( C$ g U" i) U5 {echo "<div id=\"admin-options\"> ";
! v! Q9 S7 W+ |0 q
9 E9 C2 V9 d: v! y+ |global $themename, $shortname, $options;
, Y$ H5 `1 p/ w* {& ^6 gif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';4 {/ X: I# ]# r3 ~
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';. S) W5 y) e/ C' n U8 b) K
?>
: G' L- ^- ]9 f2 K7 h& M1 a' F- V" @( t/ S) c8 a6 p
<h4><?php echo "$themename"; ?> Theme Options</h4>
f! k+ Z# s- K0 B* H) [" G! `9 C A! y2 M) ~
<div class="annouce">( C8 ]7 B# ^5 p ~
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>- \: C6 G7 @1 y* f$ q8 u/ e
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
r% S( _* i2 |- G</div>
4 e! {* s0 o# @* V" j( G' }1 O. h/ Y4 l" i
<form action="" method="post">
/ Q/ M7 K& t; Y% R" s
- e5 Q z# [# p* U d<?php foreach ($options as $value) { ?>0 p7 c0 Y1 v o3 f+ \2 A0 K/ a3 K
8 w0 [- w' B; Y y) y/ G* c<?php switch ( $value['type'] ) { case 'heading': ?>+ ~& A- O0 y& ^% ~
& S G+ C8 X* l3 y7 Y<div class="get-option">. S2 z# l$ ?/ t/ \8 ^
% R2 ?0 Z8 W0 t: o+ m<h2><?php echo $value['name']; ?></h2>3 N- F3 n8 s. p# b5 [
) v$ d" P" s! D% C+ t4 ~/ _3 Z
<div class="option-save">; I8 \+ P4 R2 X5 ~# \0 c! f8 c, a
* E9 W& k+ J. F# t R j5 F
<?php8 D7 | \- K6 f1 r/ m
break;
* G. c- ^8 p' ~case 'text':
6 H) r5 ~" W {?>3 I6 y) D8 o7 b ~; v
* p# G4 j d) Z- l. q$ E/ s<div class="description"><?php echo $value['name']; ?></div>
+ {1 n0 `! O$ z<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
7 \! G4 F2 x( [; y8 N
' _! f/ W9 D" i( H3 |$ Pget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>6 \8 c! z- F1 N, \0 I B( k5 K7 U
) S3 ?% } G( E, c4 Q: Y5 }. x& e5 R
<?php9 ]+ x- {) g) a* }! K; }
break;9 ?+ o- Q8 Q2 m7 @! b
case 'select':
/ \7 [/ l1 P2 n" c?>
; t1 E/ x4 v, B" B, i
; |& j( a5 q% S) K! G<div class="description"><?php echo $value['name']; ?></div>
, ^, ?5 a! D% Y e7 Q" j<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">7 A: B- _% S( Z. L* J1 T& ]5 H8 e
<?php foreach ($value['options'] as $option) { ?>2 k" |4 v6 v; N% a+ q% |6 V
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>( n0 x- r: A) w6 h' A9 J! g' I2 D- k
<?php } ?>4 x' s6 k% w) n
</select>* I, D" _! w' {: R6 q3 J
</p>
1 h# J# E* q4 C* C& U7 o
5 f7 b+ x E' R: b) _9 }( P' O<?php" a& h& V2 P( }6 M0 c( E: E6 b
break;% K% b0 a% \- Y( W7 p
case 'textarea':2 ]% G8 @# g9 M3 S K# |
$valuex = $value['id'];
$ v; F! D% x& ]* y, i$valuey = stripslashes($valuex);
) y) F0 A2 B* q$video_code = get_settings($valuey);; o; e/ r1 q6 K! X' o. |, H2 k" y
?>
; N/ c$ F$ n: I0 I7 x4 K* E& j& E! N/ _& E- x4 b
<div class="description"><?php echo $value['name']; ?></div>
3 f6 Z, A. r7 _0 N: l<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
2 {7 `% p1 a0 }- O3 r8 W9 G/ X9 B% W! h& k" p: ]
else { echo $value['std']; } ?></textarea></p>
: U) c: D; \; E7 l K2 w( ?% \
3 h8 }" i0 `/ f+ a6 a) f<?php
" T/ ]0 }% @4 l2 Z2 b8 ?+ w; Mbreak;
; T1 i9 a( f, J- j( y7 ]% v lcase 'close':
! k! u0 c% o f3 l6 z" ]3 P?>+ @: z$ o# T* @; j+ O7 j9 v
2 T! z; ^# \4 c! s3 f4 d4 [4 v<div class="clearfix"></div>. Y" v7 o* s, Y, k) ?5 z% y0 [
</div><!-- OPTION SAVE END -->' _& i0 }+ g3 {. g
- P# f$ g9 |; C, T# k
<div class="clearfix"></div>* H# _7 z& c/ j9 {1 X* \
</div><!-- GET OPTION END -->1 H& `: v$ H, }9 \, k
; f- A- y( e: E! m
<?php
1 R- X) d" @' n* {break;
$ s X( S% E0 x. ?: Xdefault;
# ?1 ^- I+ K! M; a?># X. }8 L" Y0 ?, D& j
- B' t+ Y* j% A) V1 I
" K9 A6 E; X: K7 [; p
<?php2 ?' K$ \2 c7 h' A, h
break; } ?>
: x; \* D" _1 N. Y! X
! k( `* M( x. @$ y# E<?php } ?>7 p' c( v* s" {
6 N7 e- J+ x; ]: l1 ]) S) x$ V
<p class="save-p">
3 ]/ F# f+ g$ a& a1 |<input name="save" type="submit" class="sbutton" value="Save Options" />1 _0 V3 S" s: B
<input type="hidden" name="action" value="save" />
$ x7 J# _; w; K8 `1 }& u1 u</p>
+ J5 r4 Q4 h5 T+ x/ S- F7 U: L</form>
- S& J7 O: ]* L) P% R( I* Q A& n+ l* s, ]% t* j" a
<form method="post">6 ]. F" x' ^# C8 R. J0 G( c
<p class="save-p">
5 N4 u! @0 Q" p7 `# S- J* E( K7 ^<input name="reset" type="submit" class="sbutton" value="Reset Options" />
, `. }& W/ e* ^6 i<input type="hidden" name="action" value="reset" />0 D0 w+ O$ }; A* B
</p>
- H6 `4 i8 l, [8 b3 y4 M</form>
- }8 G% { W' m+ T! I! P9 A. _
</div><!-- ADMIN OPTIONS END -->% F0 ~' O5 G: N; M* E. g$ I) {) m
% h. `5 Q9 u- K1 Y( N<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
. l: k9 C! E( y7 _! _9 w6 Y; }3 ^( D: M9 h" d# U5 M( {" N- z
function mytheme_admin_register() {; m; M/ A7 M8 W: E6 M @
global $themename, $shortname, $options;2 A9 [5 r! a* f4 q6 ?9 I" b
if ( $_GET['page'] == basename(__FILE__) ) {
" Z2 r9 y. ?1 L( rif ( 'save' == $_REQUEST['action'] ) {! Z5 ?, b* E$ s: u" D
foreach ($options as $value) {) N( e8 m. p2 _7 u
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
9 i5 R; L. \# @" G C7 mforeach ($options as $value) {- W+ M# m4 {5 k* p5 \5 d
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
) ?' T1 U1 K* F5 S: [5 xheader("Location: themes.php?page=functions.php&saved=true");, ~2 M, d4 r1 y* v; f& [0 f
die;3 h3 z, k1 r9 l
} else if( 'reset' == $_REQUEST['action'] ) {
0 t1 J: o' B. ^6 `) ?foreach ($options as $value) {- E2 g6 a) F8 ?% O% o
delete_option( $value['id'] ); }' r/ ~3 |/ O! k F8 a# o
header("Location: themes.php?page=functions.php&reset=true");
/ z. ]. w% E8 Q0 r) L' ydie;* ^" M) ?/ i( j) K2 a. F4 ~: G2 h% K
}9 ~, S! K% D9 n
}
& @/ j7 A# P; P& y; K! c. x; W# T2 `2 n3 Qadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');; g, E( b: a% U3 p5 J5 Z4 ^4 U& [% Y
}
1 g6 q- }4 N. C7 `1 ~. r: U* r! Y8 N
' v) D/ o/ p* e' C* n* y4 @function mytheme_admin_head() { ?>
3 F/ ~# y' b: w" u4 k5 O" T<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />( v Z, {) [# d2 I# t# A
<?php }# L& ^1 {4 R3 c
|
|