|
|

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