|
|

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