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