|
|

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