|
|

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