|
|

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