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