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