|
|

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