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