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