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