|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
# U2 y) P* V9 A. a// Theme Option
% Y9 L$ e. d& m( Z& N////////////////////////////////////////////////////////////////////////////////( T2 q' E$ f! F" N4 J1 F, d
& r# m( p% K6 Q
$themename = "Zenx";1 t( B2 |9 D' }
$shortname = str_replace(' ', '_', strtolower($themename));; t# l) Q& D9 ?) A
* e2 x: @ q. O; @& Mfunction get_theme_option($option); K8 r7 t) ^% j% p' j% M! y
{
5 n1 D' b# E9 H1 t$ v* s9 q global $shortname;, l! R, }6 o6 o" s( g9 X
return stripslashes(get_option($shortname . '_' . $option));/ n; R- ^$ c, q- H5 ]
}
5 _3 |. a. ^- ?* J, h; n; `; ^0 P7 P
function get_theme_settings($option)
, y# b4 y, ?/ e+ |4 s. C! S7 t/ K{
* V; A" B: U$ A+ c. s2 M; r7 d4 u return stripslashes(get_option($option)); f0 Z+ l! A9 i
}
) f' n* A. O5 b: n, Q% ?& K$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");7 J7 _6 |$ r. P. g8 O
$wp_getcat = array();, S X! x! g7 Z. P( ?; a
foreach ($wp_dropdown_rd_admin as $category_list) {7 ~4 Y" y# w( U4 I
$wp_getcat[$category_list->term_id] = $category_list->name;
% d! t n. ^# R}
4 E0 } S" D" A: c( n, T$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
, L0 x% ? I1 S, S T1 E$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
4 e& F; Q r2 J6 U: h$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
* K& G5 N) D; { q6 C" N! y
|. `, T0 S! w$options = array (
" g! j0 U( ]/ r# S- T7 [3 B+ P9 B6 y9 r' K2 ]$ l9 a+ j, P" b
% X3 C6 F. ~! b% D0 b' _
array( "name" => "Blog Header Settings",
P' v9 _4 R/ `+ U "type" => "heading",, E/ s& t& @3 _; S' ~* P4 l+ L
),
9 |% G r( T4 D: L7 q; y
; J) g/ c# G; h$ s, ^; ~+ V7 G2 Y array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",$ c/ e3 l8 q3 Y
"id" => $shortname."_header_logo_activate",
7 e* o' h1 s* y; ^. s6 C "type" => "select",3 {- Y( ~$ S" w9 m0 Q% _7 T
"std" => "No",, ?+ s+ a9 b. k
"options" => array("No", "Yes")),
! h4 A3 H+ D) ^9 F5 `+ i0 A$ f, j$ ^' b
9 `- G) ]. `. A6 P- z! J array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",* p* M$ V, G6 o: r4 \: m
"id" => $shortname."_logo_url",
2 X0 E6 i# E; R# s3 X, B" J "type" => "text",8 s* Q" a' A* O
"box" => "social",
/ p- ~8 F! b3 F$ M "std" => "",
# E0 R5 c" }2 ?4 ~' i- N* X ),7 \- E. Y+ ]6 F( o( A
1 V6 D5 G9 u/ w$ n* t array( "name" => "Insert Header Banner HTML Code (Header)
+ b( ?8 h9 q, s7 r2 ? <br /><em>*Recommended Size 468 x 60</em>( \& u/ l3 Y4 {" X9 R3 R" W
<br /><em>*leave blank if not use</em>",9 |! V# N3 F) s0 s; L
"id" => $shortname."_header_banner",* v9 O0 M8 p% H3 o( w P! }7 |
"type" => "textarea",
4 N' S1 p' F+ _$ ]0 I "std" => "",
* x _2 C; J# x! N+ s9 J# s ),
5 ^' H2 r1 w x/ {5 W7 {1 W1 j! u, P8 y o0 n# ]
array( "name" => "</div></div>",
8 R6 D1 t: k& h2 E5 O' Q "type" => "close",
5 ?3 m& s1 m9 k2 v' V3 m7 c ),$ h- z6 K! f4 k4 Y. V: Z; V
1 t+ D7 v; i# |* Q
8 ?: |4 A* O1 {3 Y% J. e$ f! p array( "name" => "Header Navigation Settings",
H7 ~3 T1 a5 y "type" => "heading",7 X4 ]7 u0 X( w; c
),' p3 c* |! D4 R7 r+ Y8 s0 [ {$ G
. A' ~. Z* v9 B3 i! u2 K array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
/ Z5 t- {7 Y3 i \+ s$ W3 |$ B <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
# r- }% @0 j8 t5 | <em>*Enter the page post ID number only</em><br />
0 `( W( E: H/ p* i9 E3 o <em>*separate by comma</em><br />/ E( G. \+ @/ @
<em>*Exclude pages which you don't want to show on the header navigation</em>",
3 m( n3 a$ W3 S j$ ]& S+ p "id" => $shortname."_header_page_navigation",
+ a7 M! z3 {$ M "type" => "text",
; Y, N0 {1 ^1 e$ n5 D# z "std" => "",& ^ h$ s( Y% H& c8 W& y" g
),9 H$ F% w; |6 q# {. b4 \
. g) i' i" a) V1 i! T+ M
array( "name" => "</div></div>",
7 t6 a" V0 z8 F; i4 j Q "type" => "close",5 B* J# L" _7 c2 b
),
. c1 W: J* X8 E2 Y' ?
( }$ E2 O. [6 E: x, ^- c
( d& K' n4 M' ]; e3 x9 l array( "name" => "Post Auto Thumbnails Settings",$ R! N8 z% ~0 O9 @0 D1 m
"type" => "heading",
: h+ [- q( j: p# U6 i$ O ),+ I9 D+ d4 G9 x3 ?# Y' O; `
" M9 |& @# G( F& x- V array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",& V) m1 I- v" R! Y# f4 |1 l' [
"id" => $shortname."_timthumb_activate",4 q/ ^$ b9 I: I
"type" => "select",
8 v$ ?; i% @! Q, H3 B "std" => "No",7 b, N5 b+ h/ r; S
"options" => array("No", "Yes")),* R7 b6 A. P& a9 _
/ q$ J- \* y: g+ {7 H array( "name" => "If Timthumb is enabled, Please choose its cropping method",, b+ a6 n5 L0 L% x1 J7 U
"id" => $shortname."_timthumb_cropping",! B. g: n: q$ E6 a8 S/ }
"type" => "select",* p; k( F& F/ p* \. t0 C2 z0 X. l
"std" => "",
% B: _" H0 y& j5 O9 Q! _; N+ _ "options" => $crop_position),, s4 Y7 n$ \% ]/ q, a' ^5 q& l( B
; |5 f/ p1 K4 q1 o2 @# K
array( "name" => "Insert Width Of Thumbnail Image<br />
; S, g X, N; u& ]' Y5 J <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
5 u+ Z8 ]# f) w) b* j! D <em>*Leave Blank To Use Default: 250</em><br />",+ e4 t, I8 G6 W6 D
"id" => $shortname."_thumb_width",
/ [6 b' y2 V7 X% s "type" => "text",1 a4 l$ s& ?7 |2 m* j
"std" => "",! ?$ r+ Y+ _, f& g
),
8 ]1 m7 I1 X5 F* c m& k4 f6 c" ?; U0 z6 ~9 e# L
array( "name" => "Insert Height Of Thumbnail Image<br />6 H, l5 e# A3 @/ o; {( G
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />( s0 _# {7 Q9 r; D
<em>*Leave Blank To Use Default: 200</em><br />",$ x+ ~7 a8 `% Z9 P' A7 Z0 K8 ^7 ^
"id" => $shortname."_thumb_height",
, V. B: n7 D1 {' o "type" => "text",
8 y% g4 W: X9 r/ G4 G; h2 u+ n! G& N "std" => "",
. a4 t. p- i' A }& E( v0 H% _ ),4 J# u; f3 R+ n8 p
* Z" I$ s% x+ T. |8 H0 J array( "name" => "</div></div>",# C5 F9 f* x: E% ]
"type" => "close",. ^- b( Y0 ^! U" m$ G
)," R. B" c2 z$ {
7 c+ J$ v' C% R. M! Z+ S array( "name" => "Featured Content Slider Settings",! N1 Z) q5 `+ v- c+ t5 J
"type" => "heading",* J& M' J/ G R; w$ _: t
),/ `& j5 J( z1 M& |0 v: ]! H
" l$ c4 e5 T& D& l; w4 R array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% ~$ }0 m7 ?/ j+ n7 h$ ^. j
"id" => $shortname."_featured_activate",
. N9 W& F$ P$ S4 S "type" => "select",
: V8 C: i0 \7 x1 d% ^8 n "std" => "No", F% ^5 R" c, ^- U& N2 ~/ m
"options" => array("No", "Yes")),
1 I' M& [6 P. F5 J8 Y
$ O3 n! [9 N3 t/ ?0 X. v0 k
! L0 i2 e; H$ U2 s- m' n array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",8 [1 C* {3 w6 P
"id" => $shortname."_featured_category",8 n* x% Z( h8 Q6 [1 U
"type" => "select",
3 {3 _& G( V; j/ w( f "std" => "Choose a category:",3 h9 f3 q- u l/ A! k& q4 K
"options" => $wp_getcat),1 G' x0 |. E% Q) C8 c: J$ v! C
- T( s1 A# q# \6 D array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
2 [% B; u$ Q6 w( K4 \4 w$ ^5 x0 n "id" => $shortname."_featured_number",
$ Y9 E* I/ c# R$ v5 D8 [6 N0 W+ l "type" => "select",0 C; K! i0 P/ |* d; ~+ m" m" s
"std" => "Number of post:",
$ @# Z) a. N' Z! ]0 k/ H% w "options" => $number_entries),) S" x" D, Q/ j) W( b
1 s; S! j6 W* I1 e* q
array( "name" => "</div></div>",/ k+ g1 n2 H( v5 F$ P+ t4 T" E7 W6 R
"type" => "close",
- F! U+ U" t5 H! L+ W$ n ),
# m- ~% E' A3 c5 G0 B! C. J
1 h/ F! d8 v( u4 q array( "name" => "Featured Category Settings",/ g# Y V# e& \% I6 G8 \+ s
"type" => "heading",
$ ^2 n; V, c6 t, `' _# @' r M ),( J% N! e2 ~5 a8 k7 z/ e* B; G
1 e- i J; i% P! C3 w. E
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
4 I; v% U% @8 u5 V! ] "id" => $shortname."_featured_category_activate",
9 g5 U2 e; L! T: u3 ] "type" => "select",& j" C* G$ y8 a7 V
"std" => "No",& e) O& h! K4 k8 d5 n" K
"options" => array("No", "Yes")),+ s; E( |7 f+ `# m5 u. l1 U8 X
6 \( f" m) C: f" @2 W
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
. P% X& E) a5 c "id" => $shortname."_featured_category_id1",
8 A9 w( e) V: H$ B& A9 c "type" => "select",- [+ J) r: \5 c4 n/ ]6 q0 h
"std" => "Choose a category:",) S+ C4 C8 w9 }) M; q
"options" => $wp_getcat),
! k' ~" i$ U, W - l6 X; f. E) z
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",) C* w1 M: I7 U# t7 E+ U v _
"id" => $shortname."_featured_number1",( F) c/ H( J+ A; S% ]2 e
"type" => "select",4 k" [# w6 o' x! N
"std" => "Number of post:",
) k, ]. w& W! s1 i "options" => $number_entries),
7 N4 l) H* }( o$ D0 }+ c, o , ~8 F* d0 `' h7 g" n- k
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>", x0 |' ^* v3 C* B: v
"id" => $shortname."_featured_category_id2",+ \6 Z/ l9 \+ f; L: `! g
"type" => "select",
: c g3 f; O- q: j, u' O G* P "std" => "Choose a category:",
. q9 f7 y9 [* a "options" => $wp_getcat),2 X, G- x/ ^3 V/ Z* A+ w1 \ R8 e
: e% K. ^1 M" b: }) k6 u& h
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>"," L, q5 f& l. }" N9 B' k' l
"id" => $shortname."_featured_number2",. l5 {, k2 j: u5 O( j
"type" => "select",1 K, p/ d5 q# V$ a$ a
"std" => "Number of post:",) j5 N- _4 z& O9 u+ o6 B4 M
"options" => $number_entries),
, j: N% ~; I4 {
) ]5 r) ]2 `! s7 p6 k * m! `# z0 F$ n) k, q, ^8 G( T/ t, f+ F
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
2 Q5 ~; [* A; z* W! X "id" => $shortname."_featured_category_id3",
1 T! h: P" v1 b0 \: H6 F "type" => "select",( j [* L) a d H
"std" => "Choose a category:",: g" E9 W6 E5 S* ?
"options" => $wp_getcat),
+ j7 N6 q7 f7 J# t6 e, J2 | 1 b* n" |! G" l7 p" D) f
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",% N$ b$ ]7 P* J0 a
"id" => $shortname."_featured_number3",
$ h2 B+ o, n! y5 J4 w5 M "type" => "select",
& Y: ]+ q" u8 k "std" => "Number of post:",
$ k+ z5 d5 y& y* _: q1 u8 @ "options" => $number_entries),; D Y6 H- `3 f9 [, C3 M
8 Z8 Z# W' i8 f W+ P
' e( O9 @% A/ @# H: r8 j array( "name" => "</div></div>", x8 r; m* Z' o
"type" => "close",5 |0 l2 l5 n5 v( ?6 [) n: Y4 f5 J
)," r, n; P1 a" w8 t) G* t
3 Q& [0 q0 A& c' _9 ~4 b. r: T6 h; q/ F) r. ^ C# M; y
array( "name" => "Google Adsense & Analytics Settings",8 ?5 B5 N `" X) X8 l% ?
"type" => "heading",( [! j' i$ k- h: P0 O
),5 j+ K5 i$ _0 f4 Q
: \/ |) K/ U# m& B# ~
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
K. @- |0 G! X "id" => $shortname."_adsense_loop_activate",
) ^3 F, I' l x# e1 Q. W3 t! T "type" => "select",: t# G+ I) P# }6 L$ H2 [$ g
"std" => "Disable",
) ^2 ~5 m; @3 V8 _" w "options" => array("Disable", "Enable")),
4 u( G; E+ |% d' z i* ^5 R- G+ D( R% U2 Q* ~5 w/ c! i
array( "name" => "Insert Google Adsense Code For Loops Here<br />
7 f) \6 _ K2 R# g <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",% d( l* g% ]$ ^3 h& l
"id" => $shortname."_adsense_loop",
' l! G+ G9 I8 T( B/ \# N5 {& a "type" => "textarea",9 O1 A, ~2 l& A' Q9 y
"std" => "",
7 r* Y; d; _9 b5 w a0 K" k ),9 ~4 j8 Y; _9 i( A3 s
3 J$ y& }9 M2 N+ ^4 U array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",, @# e4 v4 x& S4 ~
"id" => $shortname."_adsense_single_activate",% l' H: G) S3 L& Z. M* e
"type" => "select",& I' x: e. d ]( D, z0 y
"std" => "Disable",+ H- A# ^0 b k! R! U n, [
"options" => array("Disable", "Enable")),! D) F6 T9 O7 s. D" W/ E+ r: x
0 z4 `" v. S' p/ ]. k$ C. v$ E( X
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
$ }. i; m0 ~0 ~; A( ?1 X <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",; f3 b) L+ W1 z! I- U5 F3 F+ r
"id" => $shortname."_adsense_single",, v' Y$ p# d# Y- K5 b; @ Z+ `
"type" => "textarea",2 r- [, |3 P- A# Z( O- j$ V% g
"std" => "",
: R' d% c5 r0 ]& z7 J ),
6 B3 V" {7 k% r: n8 M5 T; l
9 Z2 Z6 q3 {0 K, s3 T, ^' x2 O2 K" q! y2 C
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
: W9 ^2 c9 D7 H+ k; B. ?$ H; E "id" => $shortname."_google_analytics"," ^1 C5 y, z0 _2 }4 ^" ]: A/ e
"type" => "textarea",
* w/ x+ J. h Y. w- z "std" => "",
& M6 [0 i6 B# H: j& {+ {" r" G ),
# @: l- t$ B1 I( i
4 V+ Y, i" e! t7 H5 Q) L array( "name" => "</div></div>",
8 P. F8 p) ?0 }/ L7 s i( h/ J "type" => "close",
4 F2 s; }, }, m4 \$ A ~+ J ),( A1 F# V) X& ^" n
* r4 P# I, u1 K# E: e 8 C6 }, d- g* G3 {& C3 T" E" ]
array( "name" => "AddThis Social Bookmarking Settings",
. N+ U% T5 _* p! i( o5 v5 N "type" => "heading",
! a! Q, A" @( t8 H1 T. y ),/ r9 j' ]2 q5 D. D/ ^7 J
# Y2 l! Q) e2 b F, g array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>+ S) C( r2 h! ?! y0 ]& u
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
1 {- [8 G$ Y% i0 X5 C "id" => $shortname."_addthis",
h/ k, R. n; u "type" => "text",, | v( q! N' z
"box" => "social",* H6 Q: k$ ?% ~' |
"std" => "",; P9 i! o& x- B
)," Q: u2 z9 S0 _1 N l$ {
2 ~6 Z& n6 n3 D8 p2 g/ E
array( "name" => "</div></div>",
2 g' q* z% `) R8 | "type" => "close",
" q+ ~. V9 I% F/ X. I ), W4 K# \4 I/ g! n3 B/ z8 n
A# V% [* D& ]
/ T& S5 P( t' M \2 J : Y, Q" [0 t( u& \
array( "name" => "YouTube Video Settings",
3 Q* W: s4 h8 i/ o) U5 {+ { "type" => "heading",3 R+ Y- g O( K3 I* D$ G
),
2 x$ o# I/ b3 ?* A. ?6 h$ L
8 O) t8 p9 v/ ]# y array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
; t1 c8 p/ _6 y "id" => $shortname."_emvideo_activate",8 _9 ~7 ?. c6 Z5 S W- U+ w6 K
"type" => "select",
2 R9 Q5 w7 @7 y6 w4 D% v "std" => "No",* N3 n' u1 }0 E, m( ^
"options" => array("No", "Yes")),
* v( H: {- O; w
( E: f6 M2 B% y+ H6 g$ S p 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>",6 c0 Z. S: _# R( F4 j
"id" => $shortname."_emvideo",7 c( |6 m( A% b
"std" => ""," h; p4 R1 z# s7 s' f* f
"type" => "text"),
6 ~& ]5 z3 r- Z+ G5 I5 H" O( n) K$ h S* n" }4 a
array( "name" => "</div></div>",( d+ [, V9 r, @1 y c# \9 F
"type" => "close",) I9 ^4 C8 O9 B7 a) H. @
),7 I/ j5 W5 w# n- s
$ k: ]+ N0 }& D( K3 v5 `' E
array( "name" => "Twitter Settings",5 ?; r, R8 Q8 m3 v4 Z" Q% Y
"type" => "heading",
# ]4 C4 @4 V5 P2 |. a* V ),# M3 G+ p$ d$ D
& z) @+ B! m9 C" f' K: r' r array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",& q8 A5 q' @4 E& A4 m. Z
"id" => $shortname."_twitter_activate",
& |; O$ B& e y2 Z$ X5 E. v "type" => "select",
- `( K5 Z i/ Y6 S' g "std" => "No",# [: Z' J6 S' u; ^2 {& S
"options" => array("No", "Yes")),
8 X6 U- e7 [: H0 \2 }/ \) E# _
0 j, [9 [2 {; D array( "name" => "Insert Your Twitter ID here
/ T0 p5 S- Z$ l/ K* b <br /><em>*leave blank if not necessary</em>
8 m8 S# A" ^: P* {+ S <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
; B6 V* |/ e, D+ p9 M "id" => $shortname."_twitter",0 ~8 K3 l/ v' U5 M6 R
"type" => "text",
6 K8 j5 ~ b4 J( N$ K( Q "box" => "social",! N6 w8 p" O2 {0 g
"std" => "",
8 P6 k7 e% z; D) b# [! U ),
1 H! r, [/ S, |& k! `0 Z% m# Q+ P/ q9 z t! x6 |; k
array( "name" => "Enter Twitter Feed Count here" F9 A- Q7 [# Y6 O$ J
<br /><em>*leave blank if not necessary</em>
, l, N8 B6 e( w! S& p4 i <br /><em>*Enter How Many Twitter Feed To Display</em>",6 }5 j$ m" }. Y' z' t/ l! I
"id" => $shortname."_twitter_count",7 w) _9 C. D4 X
"type" => "text",/ Z4 `1 g/ |4 ]" S, h" b4 _2 [
"box" => "social",
% h9 r# n% a. ~& L8 D "std" => "",6 |; y$ R# D7 K6 U
),/ N. [4 U, R/ A+ m" y; @
& ^. J: f8 D- ?# c array( "name" => "</div></div>",
) L# u9 e+ O1 @( d$ L5 Y "type" => "close",
" ~6 ~0 r" A# i* W. r! O ),
9 h$ ^( v8 k: x3 u8 b. ]
5 a# X+ ?2 T9 R3 _& N }& f: |8 F5 A$ x2 Z- I( v) P
array( "name" => "125 x 125 Banners Advertisement Settings",
( x3 ^8 i0 {2 g; M* M, c "type" => "heading", p8 E+ Q5 |! @2 W0 }) u# g
),
1 {; |1 }) w; \ - \% ?0 W, V' }
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",8 S: ^0 P: O' p- Z9 M
"id" => $shortname."_sponsor_activate",
5 R$ _4 m7 \- R2 { "type" => "select",6 G! G" o, J' O" z( ?, d
"std" => "No",6 w* Z' r) n$ h2 e, C8 s
"options" => array("No", "Yes")),
8 `+ L/ ~/ j" G. j
6 B: v3 B+ @* H+ g( L4 Z& \+ b! Y! n3 g" j
1 ~0 i/ z; x0 T array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",( v2 k; f! q ~: v
"id" => $shortname."_sponsor_banner_one",9 T4 r, k( G: X& y8 q9 i
"type" => "textarea",3 Y0 q0 g9 V& @
"std" => "",) F! I* U8 C% _% r& [1 `
), 1 T6 M: i) a6 s! W' ~+ O% R0 T
% s# u1 i! N" H( b
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",( b6 `# |, V+ g0 W
"id" => $shortname."_sponsor_banner_two",1 \% J* f* i W
"type" => "textarea",: h& W* x0 n% G, @
"std" => "",0 U2 e! a! b* f# s! G
),7 m; \0 T' x& t$ l) n/ {
7 ?5 C8 C$ I6 ?& Y# @ array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",- Y- p% p ~. s8 Q5 r8 q5 d
"id" => $shortname."_sponsor_banner_three",
; X) T9 L0 F7 e" M4 ?7 O9 w5 v "type" => "textarea",
& I1 e4 O7 |! }0 R/ A "std" => "",3 [! m# O' F6 B" I9 i: Y
),
& Y; C# g; V. u1 r( G
4 t$ n8 d$ p0 `# w: }+ U+ s0 L& l' J array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",- O& N8 x& |: L4 H1 ^
"id" => $shortname."_sponsor_banner_four",
8 @& E9 T2 f- }$ }8 g* m "type" => "textarea",& E+ E1 d1 S$ X2 U& {1 o
"std" => "",8 G$ { @6 p9 C. F, U; M X
),. J* L3 g+ u# k7 ~
+ \0 ^ p$ }; Y5 A2 \* n
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>", W, w+ I% I7 ]- _( \
"id" => $shortname."_sponsor_banner_five",
# ` _( i. p; a3 a6 K# E "type" => "textarea",) A4 M8 ]2 G+ Y) R4 h _' x% t
"std" => "",6 N p8 U& h4 A9 L2 E7 d
),0 j2 J! |% u$ B" _
5 W5 I: s( Z4 ]7 \& J# J) u2 z
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
8 _/ H6 j9 Z7 d B7 _) O "id" => $shortname."_sponsor_banner_six",# z3 P% E. Q/ w& {4 _3 ~- F, N9 h
"type" => "textarea",
+ m: H9 n) h6 I) w0 T4 n "std" => "",
1 [7 M# C& {( Z ),
7 S7 t; f% v, D* R3 u" I
3 G4 i' e5 B# L0 A' z0 ]+ B array( "name" => "</div></div>",: T5 X6 g1 v) j+ R8 Q1 N
"type" => "close",
6 ]: q/ \! H) `! ` ),
1 I* `) C9 D5 M( X
3 h1 l" a U3 i- U
- k0 W. m9 ^7 c
9 k: k- O0 f: ~3 S# [);: F8 j4 X! l0 V
9 e' Q4 o! \' L5 E# y! N2 c
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {1 c ^5 `' P5 T) q7 }, ?4 l2 ]+ _
, w" L5 Z6 @8 N4 s# v4 a3 ?& w
echo "<div id=\"admin-options\"> ";
1 v& m/ Q$ R1 H7 T8 O( Y& w( {9 }$ O1 K, d* k) Z/ a I4 G
global $themename, $shortname, $options;# U5 o' |9 e) _% ?0 w" y
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';' D) I6 f# t0 u+ M% G( I( ?
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
3 s: z, r7 z5 U?>- E1 c: [5 S( V) v$ l9 u
5 o3 a7 B' C# ?7 Y9 i
<h4><?php echo "$themename"; ?> Theme Options</h4>
4 k9 D7 {/ d- o. H/ q5 x
7 H* ^' c5 L7 J! T- A# R- t; h/ b<div class="annouce">
* f' Q" m4 Q+ ^' |<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>$ D( M3 p; O; Z g
<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>( z5 B; ?8 a X9 d3 S+ [9 f% c
</div>
1 D3 F/ }( B( U/ s, P2 G" e/ I! G- }- s3 P- a
<form action="" method="post">
! L& k+ f ?' S: ~5 G
! I( b: r; i% p5 v: U+ K5 y<?php foreach ($options as $value) { ?>
; m: q: b, z4 d- s) ?8 W6 k: V
" m4 r3 `3 @3 H. V<?php switch ( $value['type'] ) { case 'heading': ?>
4 E+ n0 q: g& M: u8 N- |0 Z, M: j: l: w2 ^, N2 h, I
<div class="get-option">
. u; \) m, ]6 e" i) b1 [4 `2 O! ~
|# t4 T, w" X8 c$ G% |. {<h2><?php echo $value['name']; ?></h2>! i" J# ]" ~6 @" o% o
4 Y2 h; n& c! n<div class="option-save">2 u6 h/ S8 r* K4 H
' k, f0 l" [) \" ]" |<?php" h3 H' [. O4 q) h- `0 b# i2 x/ B
break;) S K: S/ a1 w) b
case 'text':3 d7 J8 E5 d/ O
?>
# g. G/ m: @7 ^2 j7 k; J# L. E) i8 C/ j# [) y- [
<div class="description"><?php echo $value['name']; ?></div>) w" J; k {( x9 `5 C- R# A
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (' n" _5 u) p4 ?8 @+ T3 @2 G4 j/ T
% W3 B5 `: B+ n; n; Xget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>' B+ ^+ T# }% y: x
( t& \+ [! P1 ]( q& d$ o: s& X' C# {
<?php
1 n2 D5 u7 H1 e1 c2 Q* K! Obreak;
/ ?3 Y5 b$ [2 ?5 Z1 X" a& E2 `case 'select':7 ^& L" ~: k( y+ W' e* K r
?>
0 K- |+ f8 j$ w, z; g+ r& Z3 M e
. K% T0 u/ v5 a/ e- x0 i8 D4 \8 r: [<div class="description"><?php echo $value['name']; ?></div>
! E* n' @) `* O$ O2 G) H<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">9 w$ `) f( g& L8 N! x0 U2 L& O
<?php foreach ($value['options'] as $option) { ?>
& P. P/ |/ V6 l: a# O5 f<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
2 R* e% N5 @" Q<?php } ?>
' y5 U) j0 F3 F3 \* Z* H</select>/ g. ?7 |/ ]- c" ?
</p>
. v* @7 i3 O8 a# M |% ^: q( r2 a m2 Q: T; {" P6 W% G: b) G }6 W
<?php$ L% J! @6 Q/ R+ B
break;. R" ?; A4 {+ v# f
case 'textarea':$ a# d* M, h/ ^/ Q' t
$valuex = $value['id'];
4 V( r$ Q: k w7 h3 V$valuey = stripslashes($valuex);' L. O% x' @7 T1 j" u3 E. D
$video_code = get_settings($valuey);/ Q; _. C7 b' ? k4 y
?>' ?2 Y, ]* U- x8 }# q, W" R7 x
% O' h; n5 U) W) A+ v: {<div class="description"><?php echo $value['name']; ?></div>
+ M3 `- _5 P% F' d& v<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }5 B3 n( a! j$ H
( \, y9 k6 U0 g$ Selse { echo $value['std']; } ?></textarea></p>
9 E5 U6 _( ]+ @! b, v
9 g0 X' ?& o5 w2 T<?php
7 }4 `: j5 N/ I' C" [break;
! \3 b. f. w8 w/ m, R+ `, Ucase 'close':
$ i4 ^, t9 G! E! b$ k/ Z f?>
5 W5 v* x3 U" ~ L6 J& f
% _# I) _2 r+ f( g$ i) _* l8 f<div class="clearfix"></div>, F. N0 _# ?1 {) P8 D& e
</div><!-- OPTION SAVE END -->
% F- B& Q/ G0 w8 O2 m6 E
4 ~4 K; M: y7 z1 M+ w7 n+ g<div class="clearfix"></div>
4 O2 U5 h% X4 }, V9 h' [, P</div><!-- GET OPTION END -->
5 X6 h2 x9 P2 \% n7 g8 c1 k: V r+ @' D: w
<?php
6 Q7 _" T! V2 Q- }3 V" Tbreak;1 e; U# t) Y' v$ Y! b3 A2 G
default;0 N5 d9 i( R& s6 Y: |
?>
9 z5 K7 }0 v: A. { [
( I5 S- t1 Y( `9 y* g! H
; A! U" S. H0 k0 N# N5 F! [<?php
5 i7 F& o( g2 q% k" Mbreak; } ?>) u$ R" w: E5 z# K0 }( d, Z
" V! x7 D3 K% O4 |
<?php } ?>% c5 I/ s2 h8 o- E0 J
) Z+ K$ v( p9 j$ ]3 d' N" \1 z<p class="save-p">
; L- t8 L, {1 `8 l: G) Q<input name="save" type="submit" class="sbutton" value="Save Options" />, v! a7 e/ f6 {/ J
<input type="hidden" name="action" value="save" />' K2 L, u/ N0 k! {
</p>" L! N) v2 {- Q0 }
</form>& T: T2 m9 \) v2 s" ~8 H4 W
, `+ z. Y" W* L7 |<form method="post">
1 Y0 ]4 p% A" l2 ~8 X<p class="save-p">. V# |' D# c: N2 R5 I* Q( l
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
# Z: ^) c2 S2 x5 a4 i6 s2 u2 @<input type="hidden" name="action" value="reset" />
% f: e4 |! E( K4 f% m</p>
( I: T+ I/ b# F s& U</form> G# r" g R& F* ^1 {7 z
. h9 \# \7 z* |# g. i% r" i
</div><!-- ADMIN OPTIONS END -->
; E4 `/ h \( a9 H/ F0 t9 x1 R3 L
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }8 O7 v% [. g5 w: g% }$ {
3 k& R! x b# F k2 @3 d- f1 dfunction mytheme_admin_register() {
4 s* n8 s& \. O* X, J l. D! k2 Zglobal $themename, $shortname, $options;
, H& z+ E& C; ^( g, s) c5 J& Y7 q6 uif ( $_GET['page'] == basename(__FILE__) ) {
7 t* W. h$ T0 l' M, J; G, H* ^if ( 'save' == $_REQUEST['action'] ) {, C9 x4 s8 t _. U3 `( z+ Z$ ^
foreach ($options as $value) {
4 J8 C% |8 v; m$ r* Pupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }' f/ }0 j4 P( _ l
foreach ($options as $value) {
7 N$ X8 t: a0 D& u$ fif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
- a% a l0 M# M6 V5 uheader("Location: themes.php?page=functions.php&saved=true");
$ D5 _1 c% V9 N4 Udie;/ B2 Y8 r+ d) P! v) t
} else if( 'reset' == $_REQUEST['action'] ) {; [+ e3 n9 }( Y& ]2 {, Y J4 o8 M
foreach ($options as $value) {$ I! ]9 v. R! F- \& G! ~
delete_option( $value['id'] ); }/ i J5 c- j# z p4 A
header("Location: themes.php?page=functions.php&reset=true");9 y; u" k0 K) C4 q$ N
die;, |8 M) k- s; [ `+ q
}
P" Z# X# B( \}7 }7 m' B2 ^( ]! w# U2 q) b* Y. x' B
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');# Q8 |6 u6 O" j5 i! ?/ O
}
J7 \3 k7 I( U" f: s
$ }3 k/ r$ s4 z% E; R2 U# nfunction mytheme_admin_head() { ?>
3 o! `* @9 R% S& ~ \5 L<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
% T4 k! n. J! c/ j<?php }- _, I& l% t" ?, U
|
|