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